McpError class

MCP Error

Represents a JSON-RPC 2.0 error object with code, message, and optional data.

Constructors

McpError({required int code, required String message, String? data})
McpError.fromJson(Map<String, dynamic> json)
Create error from JSON map
factory

Properties

code int
Error code (integer)
final
data String?
Additional error data (optional)
final
hashCode int
The hash code for this object.
no setterinherited
message String
Error message (human-readable)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Convert to JSON map
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited