Skip to main content

Module protocol

Module protocol 

Source
Expand description

MCP JSON-RPC 2.0 protocol types.

Structs§

ContentItem
One block of tool-result content.
InitializeResult
The server’s half of the MCP initialize handshake.
JsonRpcError
The error member of a failed JsonRpcResponse.
JsonRpcRequest
One JSON-RPC 2.0 request, as read line-by-line off stdin.
JsonRpcResponse
One JSON-RPC 2.0 response, written as a single line to stdout.
ServerCapabilities
What this server offers a client.
ServerInfo
Server identity reported in the initialize handshake.
ToolCallResult
What a tools/call returns: the text a model will read.
ToolDefinition
What this server publishes, and what an agent consumes.
ToolsCapability
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::error instead, 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.