{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JsonRpcMessage_for_ClientRequest_and_ClientResult_and_ClientNotification",
"description": "Represents any JSON-RPC message that can be sent or received.\n\nThis enum covers all possible message types in the JSON-RPC protocol: individual requests/responses, notifications, batch operations, and errors. It serves as the top-level message container for MCP communication.",
"anyOf": [
{
"description": "A single request expecting a response",
"allOf": [
{
"$ref": "#/definitions/JsonRpcRequest_for_ClientRequest"
}
]
},
{
"description": "A response to a previous request",
"allOf": [
{
"$ref": "#/definitions/JsonRpcResponse_for_ClientResult"
}
]
},
{
"description": "A one-way notification (no response expected)",
"allOf": [
{
"$ref": "#/definitions/JsonRpcNotification_for_ClientNotification"
}
]
},
{
"description": "Multiple requests sent together",
"type": "array",
"items": {
"$ref": "#/definitions/JsonRpcBatchRequestItem_for_ClientRequest_and_ClientNotification"
}
},
{
"description": "Multiple responses sent together",
"type": "array",
"items": {
"$ref": "#/definitions/JsonRpcBatchResponseItem_for_ClientResult"
}
},
{
"description": "An error response",
"allOf": [
{
"$ref": "#/definitions/JsonRpcError"
}
]
}
],
"definitions": {
"Annotated_for_RawContent": {
"type": "object",
"oneOf": [
{
"type": "object",
"required": [
"text",
"type"
],
"properties": {
"text": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"text"
]
}
}
},
{
"type": "object",
"required": [
"data",
"mimeType",
"type"
],
"properties": {
"data": {
"description": "The base64-encoded image",
"type": "string"
},
"mimeType": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"image"
]
}
}
},
{
"type": "object",
"required": [
"resource",
"type"
],
"properties": {
"resource": {
"$ref": "#/definitions/ResourceContents"
},
"type": {
"type": "string",
"enum": [
"resource"
]
}
}
},
{
"type": "object",
"required": [
"data",
"mimeType",
"type"
],
"properties": {
"annotations": {
"anyOf": [
{
"$ref": "#/definitions/Annotations"
},
{
"type": "null"
}
]
},
"data": {
"type": "string"
},
"mimeType": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"audio"
]
}
}
}
],
"properties": {
"annotations": {
"anyOf": [
{
"$ref": "#/definitions/Annotations"
},
{
"type": "null"
}
]
}
}
},
"Annotations": {
"type": "object",
"properties": {
"audience": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Role"
}
},
"priority": {
"type": [
"number",
"null"
],
"format": "float"
},
"timestamp": {
"type": [
"string",
"null"
],
"format": "date-time"
}
}
},
"ArgumentInfo": {
"type": "object",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"CallToolRequestMethod": {
"type": "string",
"format": "const",
"const": "tools/call"
},
"CallToolRequestParam": {
"description": "Parameters for calling a tool provided by an MCP server.\n\nContains the tool name and optional arguments needed to execute the tool operation.",
"type": "object",
"required": [
"name"
],
"properties": {
"arguments": {
"description": "Arguments to pass to the tool (must match the tool's input schema)",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"name": {
"description": "The name of the tool to call",
"type": "string"
}
}
},
"CancelledNotificationMethod": {
"type": "string",
"format": "const",
"const": "notifications/cancelled"
},
"CancelledNotificationParam": {
"type": "object",
"required": [
"requestId"
],
"properties": {
"reason": {
"type": [
"string",
"null"
]
},
"requestId": {
"$ref": "#/definitions/NumberOrString"
}
}
},
"ClientCapabilities": {
"title": "Builder",
"description": "```rust # use rmcp::model::ClientCapabilities; let cap = ClientCapabilities::builder() .enable_experimental() .enable_roots() .enable_roots_list_changed() .build(); ```",
"type": "object",
"properties": {
"experimental": {
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
"roots": {
"anyOf": [
{
"$ref": "#/definitions/RootsCapabilities"
},
{
"type": "null"
}
]
},
"sampling": {
"type": [
"object",
"null"
],
"additionalProperties": true
}
}
},
"ClientResult": {
"anyOf": [
{
"$ref": "#/definitions/CreateMessageResult"
},
{
"$ref": "#/definitions/ListRootsResult"
},
{
"$ref": "#/definitions/EmptyObject"
}
]
},
"CompleteRequestMethod": {
"type": "string",
"format": "const",
"const": "completion/complete"
},
"CompleteRequestParam": {
"type": "object",
"required": [
"argument",
"ref"
],
"properties": {
"argument": {
"$ref": "#/definitions/ArgumentInfo"
},
"ref": {
"$ref": "#/definitions/Reference"
}
}
},
"CreateMessageResult": {
"description": "The result of a sampling/createMessage request containing the generated response.\n\nThis structure contains the generated message along with metadata about how the generation was performed and why it stopped.",
"type": "object",
"required": [
"content",
"model",
"role"
],
"properties": {
"content": {
"description": "The actual content of the message (text, image, etc.)",
"allOf": [
{
"$ref": "#/definitions/Annotated_for_RawContent"
}
]
},
"model": {
"description": "The identifier of the model that generated the response",
"type": "string"
},
"role": {
"description": "The role of the message sender (User or Assistant)",
"allOf": [
{
"$ref": "#/definitions/Role"
}
]
},
"stopReason": {
"description": "The reason why generation stopped (e.g., \"endTurn\", \"maxTokens\")",
"type": [
"string",
"null"
]
}
}
},
"EmptyObject": {
"description": "This is commonly used for representing empty objects in MCP messages.\n\nwithout returning any specific data.",
"type": "object"
},
"ErrorData": {
"description": "Error information for JSON-RPC error responses.\n\nThis structure follows the JSON-RPC 2.0 specification for error reporting, providing a standardized way to communicate errors between clients and servers.",
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"description": "The error type that occurred (using standard JSON-RPC error codes)",
"type": "integer",
"format": "int32"
},
"data": {
"description": "Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.)."
},
"message": {
"description": "A short description of the error. The message SHOULD be limited to a concise single sentence.",
"type": "string"
}
}
},
"GetPromptRequestMethod": {
"type": "string",
"format": "const",
"const": "prompts/get"
},
"GetPromptRequestParam": {
"description": "Parameters for retrieving a specific prompt",
"type": "object",
"required": [
"name"
],
"properties": {
"arguments": {
"type": [
"object",
"null"
],
"additionalProperties": true
},
"name": {
"type": "string"
}
}
},
"Implementation": {
"type": "object",
"required": [
"name",
"version"
],
"properties": {
"name": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"InitializeRequestParam": {
"description": "Parameters sent by a client when initializing a connection to an MCP server.\n\nThis contains the client's protocol version, capabilities, and implementation information, allowing the server to understand what the client supports.",
"type": "object",
"required": [
"capabilities",
"clientInfo",
"protocolVersion"
],
"properties": {
"capabilities": {
"description": "The capabilities this client supports (sampling, roots, etc.)",
"allOf": [
{
"$ref": "#/definitions/ClientCapabilities"
}
]
},
"clientInfo": {
"description": "Information about the client implementation",
"allOf": [
{
"$ref": "#/definitions/Implementation"
}
]
},
"protocolVersion": {
"description": "The MCP protocol version this client supports",
"allOf": [
{
"$ref": "#/definitions/ProtocolVersion"
}
]
}
}
},
"InitializeResultMethod": {
"type": "string",
"format": "const",
"const": "initialize"
},
"InitializedNotificationMethod": {
"type": "string",
"format": "const",
"const": "notifications/initialized"
},
"JsonRpcBatchRequestItem_for_ClientRequest_and_ClientNotification": {
"anyOf": [
{
"$ref": "#/definitions/JsonRpcRequest_for_ClientRequest"
},
{
"$ref": "#/definitions/JsonRpcNotification_for_ClientNotification"
}
]
},
"JsonRpcBatchResponseItem_for_ClientResult": {
"anyOf": [
{
"$ref": "#/definitions/JsonRpcResponse_for_ClientResult"
},
{
"$ref": "#/definitions/JsonRpcError"
}
]
},
"JsonRpcError": {
"type": "object",
"required": [
"error",
"id",
"jsonrpc"
],
"properties": {
"error": {
"$ref": "#/definitions/ErrorData"
},
"id": {
"$ref": "#/definitions/NumberOrString"
},
"jsonrpc": {
"$ref": "#/definitions/JsonRpcVersion2_0"
}
}
},
"JsonRpcNotification_for_ClientNotification": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/Notification_for_CancelledNotificationMethod_and_CancelledNotificationParam"
},
{
"$ref": "#/definitions/Notification_for_ProgressNotificationMethod_and_ProgressNotificationParam"
},
{
"$ref": "#/definitions/NotificationNoParam_for_InitializedNotificationMethod"
},
{
"$ref": "#/definitions/NotificationNoParam_for_RootsListChangedNotificationMethod"
}
],
"required": [
"jsonrpc"
],
"properties": {
"jsonrpc": {
"$ref": "#/definitions/JsonRpcVersion2_0"
}
}
},
"JsonRpcRequest_for_ClientRequest": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/RequestNoParam_for_PingRequestMethod"
},
{
"$ref": "#/definitions/Request_for_InitializeResultMethod_and_InitializeRequestParam"
},
{
"$ref": "#/definitions/Request_for_CompleteRequestMethod_and_CompleteRequestParam"
},
{
"$ref": "#/definitions/Request_for_SetLevelRequestMethod_and_SetLevelRequestParam"
},
{
"$ref": "#/definitions/Request_for_GetPromptRequestMethod_and_GetPromptRequestParam"
},
{
"$ref": "#/definitions/RequestOptionalParam_for_ListPromptsRequestMethod_and_PaginatedRequestParam"
},
{
"$ref": "#/definitions/RequestOptionalParam_for_ListResourcesRequestMethod_and_PaginatedRequestParam"
},
{
"$ref": "#/definitions/RequestOptionalParam_for_ListResourceTemplatesRequestMethod_and_PaginatedRequestParam"
},
{
"$ref": "#/definitions/Request_for_ReadResourceRequestMethod_and_ReadResourceRequestParam"
},
{
"$ref": "#/definitions/Request_for_SubscribeRequestMethod_and_SubscribeRequestParam"
},
{
"$ref": "#/definitions/Request_for_UnsubscribeRequestMethod_and_UnsubscribeRequestParam"
},
{
"$ref": "#/definitions/Request_for_CallToolRequestMethod_and_CallToolRequestParam"
},
{
"$ref": "#/definitions/RequestOptionalParam_for_ListToolsRequestMethod_and_PaginatedRequestParam"
}
],
"required": [
"id",
"jsonrpc"
],
"properties": {
"id": {
"$ref": "#/definitions/NumberOrString"
},
"jsonrpc": {
"$ref": "#/definitions/JsonRpcVersion2_0"
}
}
},
"JsonRpcResponse_for_ClientResult": {
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"$ref": "#/definitions/NumberOrString"
},
"jsonrpc": {
"$ref": "#/definitions/JsonRpcVersion2_0"
},
"result": {
"$ref": "#/definitions/ClientResult"
}
}
},
"JsonRpcVersion2_0": {
"type": "string",
"format": "const",
"const": "2.0"
},
"ListPromptsRequestMethod": {
"type": "string",
"format": "const",
"const": "prompts/list"
},
"ListResourceTemplatesRequestMethod": {
"type": "string",
"format": "const",
"const": "resources/templates/list"
},
"ListResourcesRequestMethod": {
"type": "string",
"format": "const",
"const": "resources/list"
},
"ListRootsResult": {
"type": "object",
"required": [
"roots"
],
"properties": {
"roots": {
"type": "array",
"items": {
"$ref": "#/definitions/Root"
}
}
}
},
"ListToolsRequestMethod": {
"type": "string",
"format": "const",
"const": "tools/list"
},
"LoggingLevel": {
"description": "Logging levels supported by the MCP protocol",
"type": "string",
"enum": [
"debug",
"info",
"notice",
"warning",
"error",
"critical",
"alert",
"emergency"
]
},
"NotificationNoParam_for_InitializedNotificationMethod": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/InitializedNotificationMethod"
}
}
},
"NotificationNoParam_for_RootsListChangedNotificationMethod": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/RootsListChangedNotificationMethod"
}
}
},
"Notification_for_CancelledNotificationMethod_and_CancelledNotificationParam": {
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/CancelledNotificationMethod"
},
"params": {
"$ref": "#/definitions/CancelledNotificationParam"
}
}
},
"Notification_for_ProgressNotificationMethod_and_ProgressNotificationParam": {
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/ProgressNotificationMethod"
},
"params": {
"$ref": "#/definitions/ProgressNotificationParam"
}
}
},
"NumberOrString": {
"oneOf": [
{
"type": "number"
},
{
"type": "string"
}
]
},
"PaginatedRequestParam": {
"type": "object",
"properties": {
"cursor": {
"type": [
"string",
"null"
]
}
}
},
"PingRequestMethod": {
"type": "string",
"format": "const",
"const": "ping"
},
"ProgressNotificationMethod": {
"type": "string",
"format": "const",
"const": "notifications/progress"
},
"ProgressNotificationParam": {
"type": "object",
"required": [
"progress",
"progressToken"
],
"properties": {
"message": {
"description": "An optional message describing the current progress.",
"type": [
"string",
"null"
]
},
"progress": {
"description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.",
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"progressToken": {
"$ref": "#/definitions/NumberOrString"
},
"total": {
"description": "Total number of items to process (or total progress required), if known",
"type": [
"integer",
"null"
],
"format": "uint32",
"minimum": 0.0
}
}
},
"ProtocolVersion": {
"description": "Represents the MCP protocol version used for communication.\n\nThis ensures compatibility between clients and servers by specifying which version of the Model Context Protocol is being used.",
"type": "string"
},
"ReadResourceRequestMethod": {
"type": "string",
"format": "const",
"const": "resources/read"
},
"ReadResourceRequestParam": {
"description": "Parameters for reading a specific resource",
"type": "object",
"required": [
"uri"
],
"properties": {
"uri": {
"description": "The URI of the resource to read",
"type": "string"
}
}
},
"Reference": {
"oneOf": [
{
"type": "object",
"required": [
"type",
"uri"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ref/resource"
]
},
"uri": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"ref/prompt"
]
}
}
}
]
},
"RequestNoParam_for_PingRequestMethod": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/PingRequestMethod"
}
}
},
"RequestOptionalParam_for_ListPromptsRequestMethod_and_PaginatedRequestParam": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/ListPromptsRequestMethod"
},
"params": {
"anyOf": [
{
"$ref": "#/definitions/PaginatedRequestParam"
},
{
"type": "null"
}
]
}
}
},
"RequestOptionalParam_for_ListResourceTemplatesRequestMethod_and_PaginatedRequestParam": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/ListResourceTemplatesRequestMethod"
},
"params": {
"anyOf": [
{
"$ref": "#/definitions/PaginatedRequestParam"
},
{
"type": "null"
}
]
}
}
},
"RequestOptionalParam_for_ListResourcesRequestMethod_and_PaginatedRequestParam": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/ListResourcesRequestMethod"
},
"params": {
"anyOf": [
{
"$ref": "#/definitions/PaginatedRequestParam"
},
{
"type": "null"
}
]
}
}
},
"RequestOptionalParam_for_ListToolsRequestMethod_and_PaginatedRequestParam": {
"type": "object",
"required": [
"method"
],
"properties": {
"method": {
"$ref": "#/definitions/ListToolsRequestMethod"
},
"params": {
"anyOf": [
{
"$ref": "#/definitions/PaginatedRequestParam"
},
{
"type": "null"
}
]
}
}
},
"Request_for_CallToolRequestMethod_and_CallToolRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/CallToolRequestMethod"
},
"params": {
"$ref": "#/definitions/CallToolRequestParam"
}
}
},
"Request_for_CompleteRequestMethod_and_CompleteRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/CompleteRequestMethod"
},
"params": {
"$ref": "#/definitions/CompleteRequestParam"
}
}
},
"Request_for_GetPromptRequestMethod_and_GetPromptRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/GetPromptRequestMethod"
},
"params": {
"$ref": "#/definitions/GetPromptRequestParam"
}
}
},
"Request_for_InitializeResultMethod_and_InitializeRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/InitializeResultMethod"
},
"params": {
"$ref": "#/definitions/InitializeRequestParam"
}
}
},
"Request_for_ReadResourceRequestMethod_and_ReadResourceRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/ReadResourceRequestMethod"
},
"params": {
"$ref": "#/definitions/ReadResourceRequestParam"
}
}
},
"Request_for_SetLevelRequestMethod_and_SetLevelRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/SetLevelRequestMethod"
},
"params": {
"$ref": "#/definitions/SetLevelRequestParam"
}
}
},
"Request_for_SubscribeRequestMethod_and_SubscribeRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/SubscribeRequestMethod"
},
"params": {
"$ref": "#/definitions/SubscribeRequestParam"
}
}
},
"Request_for_UnsubscribeRequestMethod_and_UnsubscribeRequestParam": {
"description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing: - `method`: The name of the method being called - `params`: The parameters for the method - `extensions`: Additional context data (similar to HTTP headers)",
"type": "object",
"required": [
"method",
"params"
],
"properties": {
"method": {
"$ref": "#/definitions/UnsubscribeRequestMethod"
},
"params": {
"$ref": "#/definitions/UnsubscribeRequestParam"
}
}
},
"ResourceContents": {
"anyOf": [
{
"type": "object",
"required": [
"text",
"uri"
],
"properties": {
"mime_type": {
"type": [
"string",
"null"
]
},
"text": {
"type": "string"
},
"uri": {
"type": "string"
}
}
},
{
"type": "object",
"required": [
"blob",
"uri"
],
"properties": {
"blob": {
"type": "string"
},
"mime_type": {
"type": [
"string",
"null"
]
},
"uri": {
"type": "string"
}
}
}
]
},
"Role": {
"description": "Represents the role of a participant in a conversation or message exchange.\n\nUsed in sampling and chat contexts to distinguish between different types of message senders in the conversation flow.",
"oneOf": [
{
"description": "A human user or client making a request",
"type": "string",
"enum": [
"user"
]
},
{
"description": "An AI assistant or server providing a response",
"type": "string",
"enum": [
"assistant"
]
}
]
},
"Root": {
"type": "object",
"required": [
"uri"
],
"properties": {
"name": {
"type": [
"string",
"null"
]
},
"uri": {
"type": "string"
}
}
},
"RootsCapabilities": {
"type": "object",
"properties": {
"listChanged": {
"type": [
"boolean",
"null"
]
}
}
},
"RootsListChangedNotificationMethod": {
"type": "string",
"format": "const",
"const": "notifications/roots/list_changed"
},
"SetLevelRequestMethod": {
"type": "string",
"format": "const",
"const": "logging/setLevel"
},
"SetLevelRequestParam": {
"description": "Parameters for setting the logging level",
"type": "object",
"required": [
"level"
],
"properties": {
"level": {
"description": "The desired logging level",
"allOf": [
{
"$ref": "#/definitions/LoggingLevel"
}
]
}
}
},
"SubscribeRequestMethod": {
"type": "string",
"format": "const",
"const": "resources/subscribe"
},
"SubscribeRequestParam": {
"description": "Parameters for subscribing to resource updates",
"type": "object",
"required": [
"uri"
],
"properties": {
"uri": {
"description": "The URI of the resource to subscribe to",
"type": "string"
}
}
},
"UnsubscribeRequestMethod": {
"type": "string",
"format": "const",
"const": "resources/unsubscribe"
},
"UnsubscribeRequestParam": {
"description": "Parameters for unsubscribing from resource updates",
"type": "object",
"required": [
"uri"
],
"properties": {
"uri": {
"description": "The URI of the resource to unsubscribe from",
"type": "string"
}
}
}
}
}