McpRequest class

MCP Request wrapper

Represents a JSON-RPC 2.0 request object with an ID, method name, and optional parameters.

Constructors

McpRequest({required Object id, required String method, Map<String, dynamic>? params})
McpRequest.call(String method, {Map<String, dynamic>? params})
Create request for a method call
factory
McpRequest.fromJson(Map<String, dynamic> json)
Create request from JSON map
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id Object
Unique request identifier (can be string, number, or null)
final
idString String
ID as string (for convenience)
no setter
method String
Method name to invoke
final
params Map<String, dynamic>?
Optional parameters object
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
toJsonString() String
Convert to JSON string
toString() String
A string representation of this object.
override

Operators

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