From fd7bb0552690100fd99f07b9f4f0942c2addee21 Mon Sep 17 00:00:00 2001 From: 4t145 Date: Tue, 2 Sep 2025 01:57:08 +0800 Subject: [PATCH 1/2] fix: remove batched json rpc support --- crates/rmcp/src/model.rs | 38 ------------------- crates/rmcp/src/model/meta.rs | 18 --------- crates/rmcp/src/service.rs | 19 +--------- .../streamable_http_server/session/local.rs | 18 --------- .../transport/streamable_http_server/tower.rs | 14 ------- 5 files changed, 2 insertions(+), 105 deletions(-) diff --git a/crates/rmcp/src/model.rs b/crates/rmcp/src/model.rs index 8a1046f16..75ccb3611 100644 --- a/crates/rmcp/src/model.rs +++ b/crates/rmcp/src/model.rs @@ -488,40 +488,6 @@ impl ErrorData { } } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] -#[serde(untagged)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub enum JsonRpcBatchRequestItem { - Request(JsonRpcRequest), - Notification(JsonRpcNotification), -} - -impl JsonRpcBatchRequestItem { - pub fn into_non_batch_message(self) -> JsonRpcMessage { - match self { - JsonRpcBatchRequestItem::Request(r) => JsonRpcMessage::Request(r), - JsonRpcBatchRequestItem::Notification(n) => JsonRpcMessage::Notification(n), - } - } -} - -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] -#[serde(untagged)] -#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -pub enum JsonRpcBatchResponseItem { - Response(JsonRpcResponse), - Error(JsonRpcError), -} - -impl JsonRpcBatchResponseItem { - pub fn into_non_batch_message(self) -> JsonRpcMessage { - match self { - JsonRpcBatchResponseItem::Response(r) => JsonRpcMessage::Response(r), - JsonRpcBatchResponseItem::Error(e) => JsonRpcMessage::Error(e), - } - } -} - /// Represents any JSON-RPC message that can be sent or received. /// /// This enum covers all possible message types in the JSON-RPC protocol: @@ -537,10 +503,6 @@ pub enum JsonRpcMessage), /// A one-way notification (no response expected) Notification(JsonRpcNotification), - /// Multiple requests sent together - BatchRequest(Vec>), - /// Multiple responses sent together - BatchResponse(Vec>), /// An error response Error(JsonRpcError), } diff --git a/crates/rmcp/src/model/meta.rs b/crates/rmcp/src/model/meta.rs index 13a0b4f6a..35b0c0a8a 100644 --- a/crates/rmcp/src/model/meta.rs +++ b/crates/rmcp/src/model/meta.rs @@ -170,24 +170,6 @@ where .extensions_mut() .insert(value); } - JsonRpcMessage::BatchRequest(json_rpc_batch_request_items) => { - for item in json_rpc_batch_request_items { - match item { - super::JsonRpcBatchRequestItem::Request(json_rpc_request) => { - json_rpc_request - .request - .extensions_mut() - .insert(value.clone()); - } - super::JsonRpcBatchRequestItem::Notification(json_rpc_notification) => { - json_rpc_notification - .notification - .extensions_mut() - .insert(value.clone()); - } - } - } - } _ => {} } } diff --git a/crates/rmcp/src/service.rs b/crates/rmcp/src/service.rs index 306c4c972..e915a8540 100644 --- a/crates/rmcp/src/service.rs +++ b/crates/rmcp/src/service.rs @@ -5,9 +5,8 @@ use crate::{ error::Error as McpError, model::{ CancelledNotification, CancelledNotificationParam, Extensions, GetExtensions, GetMeta, - JsonRpcBatchRequestItem, JsonRpcBatchResponseItem, JsonRpcError, JsonRpcMessage, - JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, Meta, NumberOrString, ProgressToken, - RequestId, ServerJsonRpcMessage, + JsonRpcError, JsonRpcMessage, JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, Meta, + NumberOrString, ProgressToken, RequestId, ServerJsonRpcMessage, }, transport::{IntoTransport, Transport}, }; @@ -827,20 +826,6 @@ where } } } - Event::PeerMessage(JsonRpcMessage::BatchRequest(batch)) => { - batch_messages.extend( - batch - .into_iter() - .map(JsonRpcBatchRequestItem::into_non_batch_message), - ); - } - Event::PeerMessage(JsonRpcMessage::BatchResponse(batch)) => { - batch_messages.extend( - batch - .into_iter() - .map(JsonRpcBatchResponseItem::into_non_batch_message), - ); - } } }; let sink_close_result = transport.close().await; diff --git a/crates/rmcp/src/transport/streamable_http_server/session/local.rs b/crates/rmcp/src/transport/streamable_http_server/session/local.rs index c1c4f8935..e65d1bbc0 100644 --- a/crates/rmcp/src/transport/streamable_http_server/session/local.rs +++ b/crates/rmcp/src/transport/streamable_http_server/session/local.rs @@ -472,10 +472,6 @@ impl LocalSessionWorker { OutboundChannel::Common } } - ServerJsonRpcMessage::BatchRequest(_) | ServerJsonRpcMessage::BatchResponse(_) => { - // the server side should never yield a batch request or response now - unreachable!("server side won't yield batch request or response") - } } } async fn handle_server_message( @@ -800,20 +796,6 @@ impl Worker for LocalSessionWorker { crate::model::JsonRpcMessage::Notification(notification) => { self.catch_cancellation_notification(notification) } - crate::model::JsonRpcMessage::BatchRequest(items) => { - for r in items { - match r { - crate::model::JsonRpcBatchRequestItem::Request(request) => { - if let Some(http_request_id) = http_request_id { - self.register_request(request, http_request_id) - } - } - crate::model::JsonRpcBatchRequestItem::Notification( - notification, - ) => self.catch_cancellation_notification(notification), - } - } - } _ => {} } context.send_to_handler(json_rpc_message).await?; diff --git a/crates/rmcp/src/transport/streamable_http_server/tower.rs b/crates/rmcp/src/transport/streamable_http_server/tower.rs index b3fc8b531..54375061a 100644 --- a/crates/rmcp/src/transport/streamable_http_server/tower.rs +++ b/crates/rmcp/src/transport/streamable_http_server/tower.rs @@ -304,13 +304,6 @@ where .map_err(internal_error_response("accept message"))?; Ok(accepted_response()) } - _ => Ok(Response::builder() - .status(http::StatusCode::NOT_IMPLEMENTED) - .body( - Full::new(Bytes::from("Batch requests are not supported yet")) - .boxed_unsync(), - ) - .expect("valid response")), } } else { let (session_id, transport) = self @@ -413,13 +406,6 @@ where } ClientJsonRpcMessage::Response(_json_rpc_response) => Ok(accepted_response()), ClientJsonRpcMessage::Error(_json_rpc_error) => Ok(accepted_response()), - _ => Ok(Response::builder() - .status(http::StatusCode::NOT_IMPLEMENTED) - .body( - Full::new(Bytes::from("Batch requests are not supported yet")) - .boxed_unsync(), - ) - .expect("valid response")), } } } From 05e050ee04bb6747bac50da0c55a90203f28e40b Mon Sep 17 00:00:00 2001 From: 4t145 Date: Wed, 3 Sep 2025 11:28:53 +0800 Subject: [PATCH 2/2] fix(test): fix schema --- .../client_json_rpc_message_schema.json | 34 - ...lient_json_rpc_message_schema_current.json | 1435 ------------- .../server_json_rpc_message_schema.json | 34 - ...erver_json_rpc_message_schema_current.json | 1893 ----------------- 4 files changed, 3396 deletions(-) delete mode 100644 crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json delete mode 100644 crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json diff --git a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json index 31823dff9..0fefb1238 100644 --- a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json +++ b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json @@ -27,20 +27,6 @@ } ] }, - { - "description": "Multiple requests sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchRequestItem" - } - }, - { - "description": "Multiple responses sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchResponseItem" - } - }, { "description": "An error response", "allOf": [ @@ -559,26 +545,6 @@ "format": "const", "const": "notifications/initialized" }, - "JsonRpcBatchRequestItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcRequest" - }, - { - "$ref": "#/definitions/JsonRpcNotification" - } - ] - }, - "JsonRpcBatchResponseItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcResponse" - }, - { - "$ref": "#/definitions/JsonRpcError" - } - ] - }, "JsonRpcError": { "type": "object", "properties": { diff --git a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json deleted file mode 100644 index 31823dff9..000000000 --- a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json +++ /dev/null @@ -1,1435 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "JsonRpcMessage", - "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:\nindividual requests/responses, notifications, batch operations, and errors.\nIt serves as the top-level message container for MCP communication.", - "anyOf": [ - { - "description": "A single request expecting a response", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcRequest" - } - ] - }, - { - "description": "A response to a previous request", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcResponse" - } - ] - }, - { - "description": "A one-way notification (no response expected)", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcNotification" - } - ] - }, - { - "description": "Multiple requests sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchRequestItem" - } - }, - { - "description": "Multiple responses sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchResponseItem" - } - }, - { - "description": "An error response", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcError" - } - ] - } - ], - "definitions": { - "Annotated": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - } - }, - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "text" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawTextContent" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "image" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawImageContent" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "resource" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawEmbeddedResource" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "audio" - } - }, - "allOf": [ - { - "$ref": "#/definitions/Annotated2" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "resource_link" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawResource" - } - ], - "required": [ - "type" - ] - } - ] - }, - "Annotated2": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ - "data", - "mimeType" - ] - }, - "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", - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "name", - "value" - ] - }, - "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\nthe tool operation.", - "type": "object", - "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" - } - }, - "required": [ - "name" - ] - }, - "CancelledNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/cancelled" - }, - "CancelledNotificationParam": { - "type": "object", - "properties": { - "reason": { - "type": [ - "string", - "null" - ] - }, - "requestId": { - "$ref": "#/definitions/NumberOrString" - } - }, - "required": [ - "requestId" - ] - }, - "ClientCapabilities": { - "title": "Builder", - "description": "```rust\n# use rmcp::model::ClientCapabilities;\nlet cap = ClientCapabilities::builder()\n .enable_experimental()\n .enable_roots()\n .enable_roots_list_changed()\n .build();\n```", - "type": "object", - "properties": { - "elicitation": { - "description": "Capability to handle elicitation requests from servers for interactive user input", - "anyOf": [ - { - "$ref": "#/definitions/ElicitationCapability" - }, - { - "type": "null" - } - ] - }, - "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/CreateElicitationResult" - }, - { - "$ref": "#/definitions/EmptyObject" - } - ] - }, - "CompleteRequestMethod": { - "type": "string", - "format": "const", - "const": "completion/complete" - }, - "CompleteRequestParam": { - "type": "object", - "properties": { - "argument": { - "$ref": "#/definitions/ArgumentInfo" - }, - "ref": { - "$ref": "#/definitions/Reference" - } - }, - "required": [ - "ref", - "argument" - ] - }, - "CreateElicitationResult": { - "description": "The result returned by a client in response to an elicitation request.\n\nContains the user's decision (accept/decline/cancel) and optionally their input data\nif they chose to accept the request.", - "type": "object", - "properties": { - "action": { - "description": "The user's decision on how to handle the elicitation request", - "allOf": [ - { - "$ref": "#/definitions/ElicitationAction" - } - ] - }, - "content": { - "description": "The actual data provided by the user, if they accepted the request.\nMust conform to the JSON schema specified in the original request.\nOnly present when action is Accept." - } - }, - "required": [ - "action" - ] - }, - "CreateMessageResult": { - "description": "The result of a sampling/createMessage request containing the generated response.\n\nThis structure contains the generated message along with metadata about\nhow the generation was performed and why it stopped.", - "type": "object", - "properties": { - "content": { - "description": "The actual content of the message (text, image, etc.)", - "allOf": [ - { - "$ref": "#/definitions/Annotated" - } - ] - }, - "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" - ] - } - }, - "required": [ - "model", - "role", - "content" - ] - }, - "ElicitationAction": { - "description": "Represents the possible actions a user can take in response to an elicitation request.\n\nWhen a server requests user input through elicitation, the user can:\n- Accept: Provide the requested information and continue\n- Decline: Refuse to provide the information but continue the operation\n- Cancel: Stop the entire operation", - "oneOf": [ - { - "description": "User accepts the request and provides the requested information", - "type": "string", - "const": "accept" - }, - { - "description": "User declines to provide the information but allows the operation to continue", - "type": "string", - "const": "decline" - }, - { - "description": "User cancels the entire operation", - "type": "string", - "const": "cancel" - } - ] - }, - "ElicitationCapability": { - "description": "Capability for handling elicitation requests from servers.\n\nElicitation allows servers to request interactive input from users during tool execution.\nThis capability indicates that a client can handle elicitation requests and present\nappropriate UI to users for collecting the requested information.", - "type": "object", - "properties": { - "schemaValidation": { - "description": "Whether the client supports JSON Schema validation for elicitation responses.\nWhen true, the client will validate user input against the requested_schema\nbefore sending the response back to the server.", - "type": [ - "boolean", - "null" - ] - } - } - }, - "EmptyObject": { - "description": "This is commonly used for representing empty objects in MCP messages.\n\nwithout returning any specific data.", - "type": "object" - }, - "ErrorCode": { - "description": "Standard JSON-RPC error codes used throughout the MCP protocol.\n\nThese codes follow the JSON-RPC 2.0 specification and provide\nstandardized error reporting across all MCP implementations.", - "type": "integer", - "format": "int32" - }, - "ErrorData": { - "description": "Error information for JSON-RPC error responses.\n\nThis structure follows the JSON-RPC 2.0 specification for error reporting,\nproviding a standardized way to communicate errors between clients and servers.", - "type": "object", - "properties": { - "code": { - "description": "The error type that occurred (using standard JSON-RPC error codes)", - "allOf": [ - { - "$ref": "#/definitions/ErrorCode" - } - ] - }, - "data": { - "description": "Additional information about the error. The value of this member is defined by the\nsender (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" - } - }, - "required": [ - "code", - "message" - ] - }, - "GetPromptRequestMethod": { - "type": "string", - "format": "const", - "const": "prompts/get" - }, - "GetPromptRequestParam": { - "description": "Parameters for retrieving a specific prompt", - "type": "object", - "properties": { - "arguments": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "name": { - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "Implementation": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "name", - "version" - ] - }, - "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\ninformation, allowing the server to understand what the client supports.", - "type": "object", - "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" - } - ] - } - }, - "required": [ - "protocolVersion", - "capabilities", - "clientInfo" - ] - }, - "InitializeResultMethod": { - "type": "string", - "format": "const", - "const": "initialize" - }, - "InitializedNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/initialized" - }, - "JsonRpcBatchRequestItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcRequest" - }, - { - "$ref": "#/definitions/JsonRpcNotification" - } - ] - }, - "JsonRpcBatchResponseItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcResponse" - }, - { - "$ref": "#/definitions/JsonRpcError" - } - ] - }, - "JsonRpcError": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/ErrorData" - }, - "id": { - "$ref": "#/definitions/NumberOrString" - }, - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - } - }, - "required": [ - "jsonrpc", - "id", - "error" - ] - }, - "JsonRpcNotification": { - "type": "object", - "properties": { - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - } - }, - "anyOf": [ - { - "$ref": "#/definitions/Notification" - }, - { - "$ref": "#/definitions/Notification2" - }, - { - "$ref": "#/definitions/NotificationNoParam" - }, - { - "$ref": "#/definitions/NotificationNoParam2" - } - ], - "required": [ - "jsonrpc" - ] - }, - "JsonRpcRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/NumberOrString" - }, - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - } - }, - "anyOf": [ - { - "$ref": "#/definitions/RequestNoParam" - }, - { - "$ref": "#/definitions/Request" - }, - { - "$ref": "#/definitions/Request2" - }, - { - "$ref": "#/definitions/Request3" - }, - { - "$ref": "#/definitions/Request4" - }, - { - "$ref": "#/definitions/RequestOptionalParam" - }, - { - "$ref": "#/definitions/RequestOptionalParam2" - }, - { - "$ref": "#/definitions/RequestOptionalParam3" - }, - { - "$ref": "#/definitions/Request5" - }, - { - "$ref": "#/definitions/Request6" - }, - { - "$ref": "#/definitions/Request7" - }, - { - "$ref": "#/definitions/Request8" - }, - { - "$ref": "#/definitions/RequestOptionalParam4" - } - ], - "required": [ - "jsonrpc", - "id" - ] - }, - "JsonRpcResponse": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/NumberOrString" - }, - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - }, - "result": { - "$ref": "#/definitions/ClientResult" - } - }, - "required": [ - "jsonrpc", - "id", - "result" - ] - }, - "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", - "properties": { - "roots": { - "type": "array", - "items": { - "$ref": "#/definitions/Root" - } - } - }, - "required": [ - "roots" - ] - }, - "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" - ] - }, - "Notification": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/CancelledNotificationMethod" - }, - "params": { - "$ref": "#/definitions/CancelledNotificationParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Notification2": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ProgressNotificationMethod" - }, - "params": { - "$ref": "#/definitions/ProgressNotificationParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "NotificationNoParam": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/InitializedNotificationMethod" - } - }, - "required": [ - "method" - ] - }, - "NotificationNoParam2": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/RootsListChangedNotificationMethod" - } - }, - "required": [ - "method" - ] - }, - "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", - "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": "number", - "format": "double" - }, - "progressToken": { - "$ref": "#/definitions/ProgressToken" - }, - "total": { - "description": "Total number of items to process (or total progress required), if known", - "type": [ - "number", - "null" - ], - "format": "double" - } - }, - "required": [ - "progressToken", - "progress" - ] - }, - "ProgressToken": { - "description": "A token used to track the progress of long-running operations.\n\nProgress tokens allow clients and servers to associate progress notifications\nwith specific requests, enabling real-time updates on operation status.", - "allOf": [ - { - "$ref": "#/definitions/NumberOrString" - } - ] - }, - "PromptReference": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "ProtocolVersion": { - "description": "Represents the MCP protocol version used for communication.\n\nThis ensures compatibility between clients and servers by specifying\nwhich version of the Model Context Protocol is being used.", - "type": "string" - }, - "RawEmbeddedResource": { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "resource": { - "$ref": "#/definitions/ResourceContents" - } - }, - "required": [ - "resource" - ] - }, - "RawImageContent": { - "type": "object", - "properties": { - "data": { - "description": "The base64-encoded image", - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ - "data", - "mimeType" - ] - }, - "RawResource": { - "description": "Represents a resource in the extension with metadata", - "type": "object", - "properties": { - "description": { - "description": "Optional description of the resource", - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "description": "MIME type of the resource content (\"text\" or \"blob\")", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Name of the resource", - "type": "string" - }, - "size": { - "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window us", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "uri": { - "description": "URI representing the resource location (e.g., \"file:///path/to/file\" or \"str:///content\")", - "type": "string" - } - }, - "required": [ - "uri", - "name" - ] - }, - "RawTextContent": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": [ - "text" - ] - }, - "ReadResourceRequestMethod": { - "type": "string", - "format": "const", - "const": "resources/read" - }, - "ReadResourceRequestParam": { - "description": "Parameters for reading a specific resource", - "type": "object", - "properties": { - "uri": { - "description": "The URI of the resource to read", - "type": "string" - } - }, - "required": [ - "uri" - ] - }, - "Reference": { - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "ref/resource" - } - }, - "allOf": [ - { - "$ref": "#/definitions/ResourceReference" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "ref/prompt" - } - }, - "allOf": [ - { - "$ref": "#/definitions/PromptReference" - } - ], - "required": [ - "type" - ] - } - ] - }, - "Request": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/InitializeResultMethod" - }, - "params": { - "$ref": "#/definitions/InitializeRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request2": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/CompleteRequestMethod" - }, - "params": { - "$ref": "#/definitions/CompleteRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request3": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/SetLevelRequestMethod" - }, - "params": { - "$ref": "#/definitions/SetLevelRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request4": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/GetPromptRequestMethod" - }, - "params": { - "$ref": "#/definitions/GetPromptRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request5": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ReadResourceRequestMethod" - }, - "params": { - "$ref": "#/definitions/ReadResourceRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request6": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/SubscribeRequestMethod" - }, - "params": { - "$ref": "#/definitions/SubscribeRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request7": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/UnsubscribeRequestMethod" - }, - "params": { - "$ref": "#/definitions/UnsubscribeRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request8": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/CallToolRequestMethod" - }, - "params": { - "$ref": "#/definitions/CallToolRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "RequestNoParam": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/PingRequestMethod" - } - }, - "required": [ - "method" - ] - }, - "RequestOptionalParam": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ListPromptsRequestMethod" - }, - "params": { - "anyOf": [ - { - "$ref": "#/definitions/PaginatedRequestParam" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "method" - ] - }, - "RequestOptionalParam2": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ListResourcesRequestMethod" - }, - "params": { - "anyOf": [ - { - "$ref": "#/definitions/PaginatedRequestParam" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "method" - ] - }, - "RequestOptionalParam3": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ListResourceTemplatesRequestMethod" - }, - "params": { - "anyOf": [ - { - "$ref": "#/definitions/PaginatedRequestParam" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "method" - ] - }, - "RequestOptionalParam4": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ListToolsRequestMethod" - }, - "params": { - "anyOf": [ - { - "$ref": "#/definitions/PaginatedRequestParam" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "method" - ] - }, - "ResourceContents": { - "anyOf": [ - { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "text": { - "type": "string" - }, - "uri": { - "type": "string" - } - }, - "required": [ - "uri", - "text" - ] - }, - { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "blob": { - "type": "string" - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "uri": { - "type": "string" - } - }, - "required": [ - "uri", - "blob" - ] - } - ] - }, - "ResourceReference": { - "type": "object", - "properties": { - "uri": { - "type": "string" - } - }, - "required": [ - "uri" - ] - }, - "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\ntypes of message senders in the conversation flow.", - "oneOf": [ - { - "description": "A human user or client making a request", - "type": "string", - "const": "user" - }, - { - "description": "An AI assistant or server providing a response", - "type": "string", - "const": "assistant" - } - ] - }, - "Root": { - "type": "object", - "properties": { - "name": { - "type": [ - "string", - "null" - ] - }, - "uri": { - "type": "string" - } - }, - "required": [ - "uri" - ] - }, - "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", - "properties": { - "level": { - "description": "The desired logging level", - "allOf": [ - { - "$ref": "#/definitions/LoggingLevel" - } - ] - } - }, - "required": [ - "level" - ] - }, - "SubscribeRequestMethod": { - "type": "string", - "format": "const", - "const": "resources/subscribe" - }, - "SubscribeRequestParam": { - "description": "Parameters for subscribing to resource updates", - "type": "object", - "properties": { - "uri": { - "description": "The URI of the resource to subscribe to", - "type": "string" - } - }, - "required": [ - "uri" - ] - }, - "UnsubscribeRequestMethod": { - "type": "string", - "format": "const", - "const": "resources/unsubscribe" - }, - "UnsubscribeRequestParam": { - "description": "Parameters for unsubscribing from resource updates", - "type": "object", - "properties": { - "uri": { - "description": "The URI of the resource to unsubscribe from", - "type": "string" - } - }, - "required": [ - "uri" - ] - } - } -} \ No newline at end of file diff --git a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json index d05c366ea..5c1bc0d2a 100644 --- a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json +++ b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json @@ -27,20 +27,6 @@ } ] }, - { - "description": "Multiple requests sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchRequestItem" - } - }, - { - "description": "Multiple responses sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchResponseItem" - } - }, { "description": "An error response", "allOf": [ @@ -690,26 +676,6 @@ "serverInfo" ] }, - "JsonRpcBatchRequestItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcRequest" - }, - { - "$ref": "#/definitions/JsonRpcNotification" - } - ] - }, - "JsonRpcBatchResponseItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcResponse" - }, - { - "$ref": "#/definitions/JsonRpcError" - } - ] - }, "JsonRpcError": { "type": "object", "properties": { diff --git a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json deleted file mode 100644 index d05c366ea..000000000 --- a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json +++ /dev/null @@ -1,1893 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "JsonRpcMessage", - "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:\nindividual requests/responses, notifications, batch operations, and errors.\nIt serves as the top-level message container for MCP communication.", - "anyOf": [ - { - "description": "A single request expecting a response", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcRequest" - } - ] - }, - { - "description": "A response to a previous request", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcResponse" - } - ] - }, - { - "description": "A one-way notification (no response expected)", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcNotification" - } - ] - }, - { - "description": "Multiple requests sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchRequestItem" - } - }, - { - "description": "Multiple responses sent together", - "type": "array", - "items": { - "$ref": "#/definitions/JsonRpcBatchResponseItem" - } - }, - { - "description": "An error response", - "allOf": [ - { - "$ref": "#/definitions/JsonRpcError" - } - ] - } - ], - "definitions": { - "Annotated": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - } - }, - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "text" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawTextContent" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "image" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawImageContent" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "resource" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawEmbeddedResource" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "audio" - } - }, - "allOf": [ - { - "$ref": "#/definitions/Annotated2" - } - ], - "required": [ - "type" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "resource_link" - } - }, - "allOf": [ - { - "$ref": "#/definitions/RawResource" - } - ], - "required": [ - "type" - ] - } - ] - }, - "Annotated2": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ - "data", - "mimeType" - ] - }, - "Annotated3": { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "resource": { - "$ref": "#/definitions/ResourceContents" - } - }, - "required": [ - "resource" - ] - }, - "Annotated4": { - "description": "Represents a resource in the extension with metadata", - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "description": "Optional description of the resource", - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "description": "MIME type of the resource content (\"text\" or \"blob\")", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Name of the resource", - "type": "string" - }, - "size": { - "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window us", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "uri": { - "description": "URI representing the resource location (e.g., \"file:///path/to/file\" or \"str:///content\")", - "type": "string" - } - }, - "required": [ - "uri", - "name" - ] - }, - "Annotated5": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "uriTemplate": { - "type": "string" - } - }, - "required": [ - "uriTemplate", - "name" - ] - }, - "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" - } - } - }, - "CallToolResult": { - "description": "The result of a tool call operation.\n\nContains the content returned by the tool execution and an optional\nflag indicating whether the operation resulted in an error.", - "type": "object", - "properties": { - "_meta": { - "description": "Optional protocol-level metadata for this result", - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "content": { - "description": "The content returned by the tool (text, images, etc.)", - "type": "array", - "items": { - "$ref": "#/definitions/Annotated" - } - }, - "isError": { - "description": "Whether this result represents an error condition", - "type": [ - "boolean", - "null" - ] - }, - "structuredContent": { - "description": "An optional JSON object that represents the structured result of the tool call" - } - }, - "required": [ - "content" - ] - }, - "CancelledNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/cancelled" - }, - "CancelledNotificationParam": { - "type": "object", - "properties": { - "reason": { - "type": [ - "string", - "null" - ] - }, - "requestId": { - "$ref": "#/definitions/NumberOrString" - } - }, - "required": [ - "requestId" - ] - }, - "CompleteResult": { - "type": "object", - "properties": { - "completion": { - "$ref": "#/definitions/CompletionInfo" - } - }, - "required": [ - "completion" - ] - }, - "CompletionInfo": { - "type": "object", - "properties": { - "hasMore": { - "type": [ - "boolean", - "null" - ] - }, - "total": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "values": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "values" - ] - }, - "ContextInclusion": { - "description": "Specifies how much context should be included in sampling requests.\n\nThis allows clients to control what additional context information\nshould be provided to the LLM when processing sampling requests.", - "oneOf": [ - { - "description": "Include context from all connected MCP servers", - "type": "string", - "const": "allServers" - }, - { - "description": "Include no additional context", - "type": "string", - "const": "none" - }, - { - "description": "Include context only from the requesting server", - "type": "string", - "const": "thisServer" - } - ] - }, - "CreateElicitationRequestParam": { - "description": "Parameters for creating an elicitation request to gather user input.\n\nThis structure contains everything needed to request interactive input from a user:\n- A human-readable message explaining what information is needed\n- A JSON schema defining the expected structure of the response", - "type": "object", - "properties": { - "message": { - "description": "Human-readable message explaining what input is needed from the user.\nThis should be clear and provide sufficient context for the user to understand\nwhat information they need to provide.", - "type": "string" - }, - "requestedSchema": { - "description": "JSON Schema defining the expected structure and validation rules for the user's response.\nThis allows clients to validate input and provide appropriate UI controls.\nMust be a valid JSON Schema Draft 2020-12 object.", - "type": "object", - "additionalProperties": true - } - }, - "required": [ - "message", - "requestedSchema" - ] - }, - "CreateElicitationResult": { - "description": "The result returned by a client in response to an elicitation request.\n\nContains the user's decision (accept/decline/cancel) and optionally their input data\nif they chose to accept the request.", - "type": "object", - "properties": { - "action": { - "description": "The user's decision on how to handle the elicitation request", - "allOf": [ - { - "$ref": "#/definitions/ElicitationAction" - } - ] - }, - "content": { - "description": "The actual data provided by the user, if they accepted the request.\nMust conform to the JSON schema specified in the original request.\nOnly present when action is Accept." - } - }, - "required": [ - "action" - ] - }, - "CreateMessageRequestMethod": { - "type": "string", - "format": "const", - "const": "sampling/createMessage" - }, - "CreateMessageRequestParam": { - "description": "Parameters for creating a message through LLM sampling.\n\nThis structure contains all the necessary information for a client to\ngenerate an LLM response, including conversation history, model preferences,\nand generation parameters.", - "type": "object", - "properties": { - "includeContext": { - "description": "How much context to include from MCP servers", - "anyOf": [ - { - "$ref": "#/definitions/ContextInclusion" - }, - { - "type": "null" - } - ] - }, - "maxTokens": { - "description": "Maximum number of tokens to generate", - "type": "integer", - "format": "uint32", - "minimum": 0 - }, - "messages": { - "description": "The conversation history and current messages", - "type": "array", - "items": { - "$ref": "#/definitions/SamplingMessage" - } - }, - "metadata": { - "description": "Additional metadata for the request" - }, - "modelPreferences": { - "description": "Preferences for model selection and behavior", - "anyOf": [ - { - "$ref": "#/definitions/ModelPreferences" - }, - { - "type": "null" - } - ] - }, - "stopSequences": { - "description": "Sequences that should stop generation", - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - }, - "systemPrompt": { - "description": "System prompt to guide the model's behavior", - "type": [ - "string", - "null" - ] - }, - "temperature": { - "description": "Temperature for controlling randomness (0.0 to 1.0)", - "type": [ - "number", - "null" - ], - "format": "float" - } - }, - "required": [ - "messages", - "maxTokens" - ] - }, - "ElicitationAction": { - "description": "Represents the possible actions a user can take in response to an elicitation request.\n\nWhen a server requests user input through elicitation, the user can:\n- Accept: Provide the requested information and continue\n- Decline: Refuse to provide the information but continue the operation\n- Cancel: Stop the entire operation", - "oneOf": [ - { - "description": "User accepts the request and provides the requested information", - "type": "string", - "const": "accept" - }, - { - "description": "User declines to provide the information but allows the operation to continue", - "type": "string", - "const": "decline" - }, - { - "description": "User cancels the entire operation", - "type": "string", - "const": "cancel" - } - ] - }, - "ElicitationCreateRequestMethod": { - "type": "string", - "format": "const", - "const": "elicitation/create" - }, - "EmptyObject": { - "description": "This is commonly used for representing empty objects in MCP messages.\n\nwithout returning any specific data.", - "type": "object" - }, - "ErrorCode": { - "description": "Standard JSON-RPC error codes used throughout the MCP protocol.\n\nThese codes follow the JSON-RPC 2.0 specification and provide\nstandardized error reporting across all MCP implementations.", - "type": "integer", - "format": "int32" - }, - "ErrorData": { - "description": "Error information for JSON-RPC error responses.\n\nThis structure follows the JSON-RPC 2.0 specification for error reporting,\nproviding a standardized way to communicate errors between clients and servers.", - "type": "object", - "properties": { - "code": { - "description": "The error type that occurred (using standard JSON-RPC error codes)", - "allOf": [ - { - "$ref": "#/definitions/ErrorCode" - } - ] - }, - "data": { - "description": "Additional information about the error. The value of this member is defined by the\nsender (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" - } - }, - "required": [ - "code", - "message" - ] - }, - "GetPromptResult": { - "type": "object", - "properties": { - "description": { - "type": [ - "string", - "null" - ] - }, - "messages": { - "type": "array", - "items": { - "$ref": "#/definitions/PromptMessage" - } - } - }, - "required": [ - "messages" - ] - }, - "Implementation": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "name", - "version" - ] - }, - "InitializeResult": { - "description": "The server's response to an initialization request.\n\nContains the server's protocol version, capabilities, and implementation\ninformation, along with optional instructions for the client.", - "type": "object", - "properties": { - "capabilities": { - "description": "The capabilities this server provides (tools, resources, prompts, etc.)", - "allOf": [ - { - "$ref": "#/definitions/ServerCapabilities" - } - ] - }, - "instructions": { - "description": "Optional human-readable instructions about using this server", - "type": [ - "string", - "null" - ] - }, - "protocolVersion": { - "description": "The MCP protocol version this server supports", - "allOf": [ - { - "$ref": "#/definitions/ProtocolVersion" - } - ] - }, - "serverInfo": { - "description": "Information about the server implementation", - "allOf": [ - { - "$ref": "#/definitions/Implementation" - } - ] - } - }, - "required": [ - "protocolVersion", - "capabilities", - "serverInfo" - ] - }, - "JsonRpcBatchRequestItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcRequest" - }, - { - "$ref": "#/definitions/JsonRpcNotification" - } - ] - }, - "JsonRpcBatchResponseItem": { - "anyOf": [ - { - "$ref": "#/definitions/JsonRpcResponse" - }, - { - "$ref": "#/definitions/JsonRpcError" - } - ] - }, - "JsonRpcError": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/ErrorData" - }, - "id": { - "$ref": "#/definitions/NumberOrString" - }, - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - } - }, - "required": [ - "jsonrpc", - "id", - "error" - ] - }, - "JsonRpcNotification": { - "type": "object", - "properties": { - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - } - }, - "anyOf": [ - { - "$ref": "#/definitions/Notification" - }, - { - "$ref": "#/definitions/Notification2" - }, - { - "$ref": "#/definitions/Notification3" - }, - { - "$ref": "#/definitions/Notification4" - }, - { - "$ref": "#/definitions/NotificationNoParam" - }, - { - "$ref": "#/definitions/NotificationNoParam2" - }, - { - "$ref": "#/definitions/NotificationNoParam3" - } - ], - "required": [ - "jsonrpc" - ] - }, - "JsonRpcRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/NumberOrString" - }, - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - } - }, - "anyOf": [ - { - "$ref": "#/definitions/RequestNoParam" - }, - { - "$ref": "#/definitions/Request" - }, - { - "$ref": "#/definitions/RequestNoParam2" - }, - { - "$ref": "#/definitions/Request2" - } - ], - "required": [ - "jsonrpc", - "id" - ] - }, - "JsonRpcResponse": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/NumberOrString" - }, - "jsonrpc": { - "$ref": "#/definitions/JsonRpcVersion2_0" - }, - "result": { - "$ref": "#/definitions/ServerResult" - } - }, - "required": [ - "jsonrpc", - "id", - "result" - ] - }, - "JsonRpcVersion2_0": { - "type": "string", - "format": "const", - "const": "2.0" - }, - "ListPromptsResult": { - "type": "object", - "properties": { - "nextCursor": { - "type": [ - "string", - "null" - ] - }, - "prompts": { - "type": "array", - "items": { - "$ref": "#/definitions/Prompt" - } - } - }, - "required": [ - "prompts" - ] - }, - "ListResourceTemplatesResult": { - "type": "object", - "properties": { - "nextCursor": { - "type": [ - "string", - "null" - ] - }, - "resourceTemplates": { - "type": "array", - "items": { - "$ref": "#/definitions/Annotated5" - } - } - }, - "required": [ - "resourceTemplates" - ] - }, - "ListResourcesResult": { - "type": "object", - "properties": { - "nextCursor": { - "type": [ - "string", - "null" - ] - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/Annotated4" - } - } - }, - "required": [ - "resources" - ] - }, - "ListRootsRequestMethod": { - "type": "string", - "format": "const", - "const": "roots/list" - }, - "ListToolsResult": { - "type": "object", - "properties": { - "nextCursor": { - "type": [ - "string", - "null" - ] - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/definitions/Tool" - } - } - }, - "required": [ - "tools" - ] - }, - "LoggingLevel": { - "description": "Logging levels supported by the MCP protocol", - "type": "string", - "enum": [ - "debug", - "info", - "notice", - "warning", - "error", - "critical", - "alert", - "emergency" - ] - }, - "LoggingMessageNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/message" - }, - "LoggingMessageNotificationParam": { - "description": "Parameters for a logging message notification", - "type": "object", - "properties": { - "data": { - "description": "The actual log data" - }, - "level": { - "description": "The severity level of this log message", - "allOf": [ - { - "$ref": "#/definitions/LoggingLevel" - } - ] - }, - "logger": { - "description": "Optional logger name that generated this message", - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "level", - "data" - ] - }, - "ModelHint": { - "description": "A hint suggesting a preferred model name or family.\n\nModel hints are advisory suggestions that help clients choose appropriate\nmodels. They can be specific model names or general families like \"claude\" or \"gpt\".", - "type": "object", - "properties": { - "name": { - "description": "The suggested model name or family identifier", - "type": [ - "string", - "null" - ] - } - } - }, - "ModelPreferences": { - "description": "Preferences for model selection and behavior in sampling requests.\n\nThis allows servers to express their preferences for which model to use\nand how to balance different priorities when the client has multiple\nmodel options available.", - "type": "object", - "properties": { - "costPriority": { - "description": "Priority for cost optimization (0.0 to 1.0, higher = prefer cheaper models)", - "type": [ - "number", - "null" - ], - "format": "float" - }, - "hints": { - "description": "Specific model names or families to prefer (e.g., \"claude\", \"gpt\")", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ModelHint" - } - }, - "intelligencePriority": { - "description": "Priority for intelligence/capability (0.0 to 1.0, higher = prefer more capable models)", - "type": [ - "number", - "null" - ], - "format": "float" - }, - "speedPriority": { - "description": "Priority for speed/latency (0.0 to 1.0, higher = prefer faster models)", - "type": [ - "number", - "null" - ], - "format": "float" - } - } - }, - "Notification": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/CancelledNotificationMethod" - }, - "params": { - "$ref": "#/definitions/CancelledNotificationParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Notification2": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ProgressNotificationMethod" - }, - "params": { - "$ref": "#/definitions/ProgressNotificationParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Notification3": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/LoggingMessageNotificationMethod" - }, - "params": { - "$ref": "#/definitions/LoggingMessageNotificationParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Notification4": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ResourceUpdatedNotificationMethod" - }, - "params": { - "$ref": "#/definitions/ResourceUpdatedNotificationParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "NotificationNoParam": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ResourceListChangedNotificationMethod" - } - }, - "required": [ - "method" - ] - }, - "NotificationNoParam2": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ToolListChangedNotificationMethod" - } - }, - "required": [ - "method" - ] - }, - "NotificationNoParam3": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/PromptListChangedNotificationMethod" - } - }, - "required": [ - "method" - ] - }, - "NumberOrString": { - "oneOf": [ - { - "type": "number" - }, - { - "type": "string" - } - ] - }, - "PingRequestMethod": { - "type": "string", - "format": "const", - "const": "ping" - }, - "ProgressNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/progress" - }, - "ProgressNotificationParam": { - "type": "object", - "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": "number", - "format": "double" - }, - "progressToken": { - "$ref": "#/definitions/ProgressToken" - }, - "total": { - "description": "Total number of items to process (or total progress required), if known", - "type": [ - "number", - "null" - ], - "format": "double" - } - }, - "required": [ - "progressToken", - "progress" - ] - }, - "ProgressToken": { - "description": "A token used to track the progress of long-running operations.\n\nProgress tokens allow clients and servers to associate progress notifications\nwith specific requests, enabling real-time updates on operation status.", - "allOf": [ - { - "$ref": "#/definitions/NumberOrString" - } - ] - }, - "Prompt": { - "description": "A prompt that can be used to generate text from a model", - "type": "object", - "properties": { - "arguments": { - "description": "Optional arguments that can be passed to customize the prompt", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/PromptArgument" - } - }, - "description": { - "description": "Optional description of what the prompt does", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "The name of the prompt", - "type": "string" - } - }, - "required": [ - "name" - ] - }, - "PromptArgument": { - "description": "Represents a prompt argument that can be passed to customize the prompt", - "type": "object", - "properties": { - "description": { - "description": "A description of what the argument is used for", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "The name of the argument", - "type": "string" - }, - "required": { - "description": "Whether this argument is required", - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "name" - ] - }, - "PromptListChangedNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/prompts/list_changed" - }, - "PromptMessage": { - "description": "A message in a prompt conversation", - "type": "object", - "properties": { - "content": { - "description": "The content of the message", - "allOf": [ - { - "$ref": "#/definitions/PromptMessageContent" - } - ] - }, - "role": { - "description": "The role of the message sender", - "allOf": [ - { - "$ref": "#/definitions/PromptMessageRole" - } - ] - } - }, - "required": [ - "role", - "content" - ] - }, - "PromptMessageContent": { - "description": "Content types that can be included in prompt messages", - "oneOf": [ - { - "description": "Plain text content", - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "const": "text" - } - }, - "required": [ - "type", - "text" - ] - }, - { - "description": "Image content with base64-encoded data", - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "data": { - "description": "The base64-encoded image", - "type": "string" - }, - "mimeType": { - "type": "string" - }, - "type": { - "type": "string", - "const": "image" - } - }, - "required": [ - "type", - "data", - "mimeType" - ] - }, - { - "description": "Embedded server-side resource", - "type": "object", - "properties": { - "resource": { - "$ref": "#/definitions/Annotated3" - }, - "type": { - "type": "string", - "const": "resource" - } - }, - "required": [ - "type", - "resource" - ] - }, - { - "description": "A link to a resource that can be fetched separately", - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "description": "Optional description of the resource", - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "description": "MIME type of the resource content (\"text\" or \"blob\")", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Name of the resource", - "type": "string" - }, - "size": { - "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window us", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "type": { - "type": "string", - "const": "resource_link" - }, - "uri": { - "description": "URI representing the resource location (e.g., \"file:///path/to/file\" or \"str:///content\")", - "type": "string" - } - }, - "required": [ - "type", - "uri", - "name" - ] - } - ] - }, - "PromptMessageRole": { - "description": "Represents the role of a message sender in a prompt conversation", - "type": "string", - "enum": [ - "user", - "assistant" - ] - }, - "PromptsCapability": { - "type": "object", - "properties": { - "listChanged": { - "type": [ - "boolean", - "null" - ] - } - } - }, - "ProtocolVersion": { - "description": "Represents the MCP protocol version used for communication.\n\nThis ensures compatibility between clients and servers by specifying\nwhich version of the Model Context Protocol is being used.", - "type": "string" - }, - "RawEmbeddedResource": { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "resource": { - "$ref": "#/definitions/ResourceContents" - } - }, - "required": [ - "resource" - ] - }, - "RawImageContent": { - "type": "object", - "properties": { - "data": { - "description": "The base64-encoded image", - "type": "string" - }, - "mimeType": { - "type": "string" - } - }, - "required": [ - "data", - "mimeType" - ] - }, - "RawResource": { - "description": "Represents a resource in the extension with metadata", - "type": "object", - "properties": { - "description": { - "description": "Optional description of the resource", - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "description": "MIME type of the resource content (\"text\" or \"blob\")", - "type": [ - "string", - "null" - ] - }, - "name": { - "description": "Name of the resource", - "type": "string" - }, - "size": { - "description": "The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.\n\nThis can be used by Hosts to display file sizes and estimate context window us", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0 - }, - "uri": { - "description": "URI representing the resource location (e.g., \"file:///path/to/file\" or \"str:///content\")", - "type": "string" - } - }, - "required": [ - "uri", - "name" - ] - }, - "RawTextContent": { - "type": "object", - "properties": { - "text": { - "type": "string" - } - }, - "required": [ - "text" - ] - }, - "ReadResourceResult": { - "description": "Result containing the contents of a read resource", - "type": "object", - "properties": { - "contents": { - "description": "The actual content of the resource", - "type": "array", - "items": { - "$ref": "#/definitions/ResourceContents" - } - } - }, - "required": [ - "contents" - ] - }, - "Request": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/CreateMessageRequestMethod" - }, - "params": { - "$ref": "#/definitions/CreateMessageRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "Request2": { - "description": "Represents a JSON-RPC request with method, parameters, and extensions.\n\nThis is the core structure for all MCP requests, containing:\n- `method`: The name of the method being called\n- `params`: The parameters for the method\n- `extensions`: Additional context data (similar to HTTP headers)", - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ElicitationCreateRequestMethod" - }, - "params": { - "$ref": "#/definitions/CreateElicitationRequestParam" - } - }, - "required": [ - "method", - "params" - ] - }, - "RequestNoParam": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/PingRequestMethod" - } - }, - "required": [ - "method" - ] - }, - "RequestNoParam2": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/ListRootsRequestMethod" - } - }, - "required": [ - "method" - ] - }, - "ResourceContents": { - "anyOf": [ - { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "text": { - "type": "string" - }, - "uri": { - "type": "string" - } - }, - "required": [ - "uri", - "text" - ] - }, - { - "type": "object", - "properties": { - "_meta": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "blob": { - "type": "string" - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "uri": { - "type": "string" - } - }, - "required": [ - "uri", - "blob" - ] - } - ] - }, - "ResourceListChangedNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/resources/list_changed" - }, - "ResourceUpdatedNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/resources/updated" - }, - "ResourceUpdatedNotificationParam": { - "description": "Parameters for a resource update notification", - "type": "object", - "properties": { - "uri": { - "description": "The URI of the resource that was updated", - "type": "string" - } - }, - "required": [ - "uri" - ] - }, - "ResourcesCapability": { - "type": "object", - "properties": { - "listChanged": { - "type": [ - "boolean", - "null" - ] - }, - "subscribe": { - "type": [ - "boolean", - "null" - ] - } - } - }, - "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\ntypes of message senders in the conversation flow.", - "oneOf": [ - { - "description": "A human user or client making a request", - "type": "string", - "const": "user" - }, - { - "description": "An AI assistant or server providing a response", - "type": "string", - "const": "assistant" - } - ] - }, - "SamplingMessage": { - "description": "A message in a sampling conversation, containing a role and content.\n\nThis represents a single message in a conversation flow, used primarily\nin LLM sampling requests where the conversation history is important\nfor generating appropriate responses.", - "type": "object", - "properties": { - "content": { - "description": "The actual content of the message (text, image, etc.)", - "allOf": [ - { - "$ref": "#/definitions/Annotated" - } - ] - }, - "role": { - "description": "The role of the message sender (User or Assistant)", - "allOf": [ - { - "$ref": "#/definitions/Role" - } - ] - } - }, - "required": [ - "role", - "content" - ] - }, - "ServerCapabilities": { - "title": "Builder", - "description": "```rust\n# use rmcp::model::ServerCapabilities;\nlet cap = ServerCapabilities::builder()\n .enable_logging()\n .enable_experimental()\n .enable_prompts()\n .enable_resources()\n .enable_tools()\n .enable_tool_list_changed()\n .build();\n```", - "type": "object", - "properties": { - "completions": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "experimental": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "object", - "additionalProperties": true - } - }, - "logging": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - }, - "prompts": { - "anyOf": [ - { - "$ref": "#/definitions/PromptsCapability" - }, - { - "type": "null" - } - ] - }, - "resources": { - "anyOf": [ - { - "$ref": "#/definitions/ResourcesCapability" - }, - { - "type": "null" - } - ] - }, - "tools": { - "anyOf": [ - { - "$ref": "#/definitions/ToolsCapability" - }, - { - "type": "null" - } - ] - } - } - }, - "ServerResult": { - "anyOf": [ - { - "$ref": "#/definitions/InitializeResult" - }, - { - "$ref": "#/definitions/CompleteResult" - }, - { - "$ref": "#/definitions/GetPromptResult" - }, - { - "$ref": "#/definitions/ListPromptsResult" - }, - { - "$ref": "#/definitions/ListResourcesResult" - }, - { - "$ref": "#/definitions/ListResourceTemplatesResult" - }, - { - "$ref": "#/definitions/ReadResourceResult" - }, - { - "$ref": "#/definitions/CallToolResult" - }, - { - "$ref": "#/definitions/ListToolsResult" - }, - { - "$ref": "#/definitions/CreateElicitationResult" - }, - { - "$ref": "#/definitions/EmptyObject" - } - ] - }, - "Tool": { - "description": "A tool that can be used by a model.", - "type": "object", - "properties": { - "annotations": { - "description": "Optional additional tool information.", - "anyOf": [ - { - "$ref": "#/definitions/ToolAnnotations" - }, - { - "type": "null" - } - ] - }, - "description": { - "description": "A description of what the tool does", - "type": [ - "string", - "null" - ] - }, - "inputSchema": { - "description": "A JSON Schema object defining the expected parameters for the tool", - "type": "object", - "additionalProperties": true - }, - "name": { - "description": "The name of the tool", - "type": "string" - }, - "outputSchema": { - "description": "An optional JSON Schema object defining the structure of the tool's output", - "type": [ - "object", - "null" - ], - "additionalProperties": true - } - }, - "required": [ - "name", - "inputSchema" - ] - }, - "ToolAnnotations": { - "description": "Additional properties describing a Tool to clients.\n\nNOTE: all properties in ToolAnnotations are **hints**.\nThey are not guaranteed to provide a faithful description of\ntool behavior (including descriptive properties like `title`).\n\nClients should never make tool use decisions based on ToolAnnotations\nreceived from untrusted servers.", - "type": "object", - "properties": { - "destructiveHint": { - "description": "If true, the tool may perform destructive updates to its environment.\nIf false, the tool performs only additive updates.\n\n(This property is meaningful only when `readOnlyHint == false`)\n\nDefault: true\nA human-readable description of the tool's purpose.", - "type": [ - "boolean", - "null" - ] - }, - "idempotentHint": { - "description": "If true, calling the tool repeatedly with the same arguments\nwill have no additional effect on the its environment.\n\n(This property is meaningful only when `readOnlyHint == false`)\n\nDefault: false.", - "type": [ - "boolean", - "null" - ] - }, - "openWorldHint": { - "description": "If true, this tool may interact with an \"open world\" of external\nentities. If false, the tool's domain of interaction is closed.\nFor example, the world of a web search tool is open, whereas that\nof a memory tool is not.\n\nDefault: true", - "type": [ - "boolean", - "null" - ] - }, - "readOnlyHint": { - "description": "If true, the tool does not modify its environment.\n\nDefault: false", - "type": [ - "boolean", - "null" - ] - }, - "title": { - "description": "A human-readable title for the tool.", - "type": [ - "string", - "null" - ] - } - } - }, - "ToolListChangedNotificationMethod": { - "type": "string", - "format": "const", - "const": "notifications/tools/list_changed" - }, - "ToolsCapability": { - "type": "object", - "properties": { - "listChanged": { - "type": [ - "boolean", - "null" - ] - } - } - } - } -} \ No newline at end of file