Expand description
MCP JSON-RPC 2.0 protocol types.
Structs§
- Content
Item - One block of tool-result content.
- Initialize
Result - The server’s half of the MCP
initializehandshake. - Json
RpcError - The
errormember of a failedJsonRpcResponse. - Json
RpcRequest - One JSON-RPC 2.0 request, as read line-by-line off stdin.
- Json
RpcResponse - One JSON-RPC 2.0 response, written as a single line to stdout.
- Server
Capabilities - What this server offers a client.
- Server
Info - Server identity reported in the
initializehandshake. - Tool
Call Result - What a
tools/callreturns: the text a model will read. - Tool
Definition - What this server publishes, and what an agent consumes.
- Tools
Capability - Details of the tools capability advertised in the handshake.
Constants§
- INTERNAL_
ERROR - JSON-RPC 2.0 spec code: the server itself failed. Currently unsent; kept beside its siblings so a future handler does not reinvent the number.
- INVALID_
PARAMS - JSON-RPC 2.0 spec code: the method exists but the parameters are
invalid. Currently unsent — a missing tool argument is reported as a
ToolCallResult::errorinstead, so the model sees it and can retry with the argument filled in. - METHOD_
NOT_ FOUND - JSON-RPC 2.0 spec code: the requested method does not exist. What the server answers for any method it does not recognise.