From 305b58e8954fc65875e86e939807d845ba9614a5 Mon Sep 17 00:00:00 2001 From: Andrew Harvard Date: Fri, 22 Aug 2025 15:59:38 -0400 Subject: [PATCH 1/2] feat(rmcp): add MCP resource_link content type - Add RawContent::ResourceLink (serde tag "resource_link") - Add PromptMessageContent::ResourceLink for prompts - Constructors: RawContent::resource_link, Content::resource_link - Embedded text uses text/plain - Keep camelCase compliance for mimeType - Unit tests for resource_link and embedded text Spec: ContentBlock includes ResourceLink and EmbeddedResource (DRAFT-2025-v3) --- crates/rmcp/src/model/content.rs | 49 +- crates/rmcp/src/model/prompt.rs | 30 + .../client_json_rpc_message_schema.json | 98 +- ...lient_json_rpc_message_schema_current.json | 1406 +++++++++++++++++ .../server_json_rpc_message_schema.json | 166 +- ...erver_json_rpc_message_schema_current.json | 262 ++- 6 files changed, 1920 insertions(+), 91 deletions(-) create mode 100644 crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json diff --git a/crates/rmcp/src/model/content.rs b/crates/rmcp/src/model/content.rs index 964f6043..a56f7241 100644 --- a/crates/rmcp/src/model/content.rs +++ b/crates/rmcp/src/model/content.rs @@ -1,4 +1,6 @@ //! Content sent around agents, extensions, and LLMs +//! NOTE: This file models MCP ContentBlock union types. Keep in sync with MCP draft schema. + //! The various content types can be display to humans but also understood by models //! They include optional annotations used to help inform agent usage use serde::{Deserialize, Serialize}; @@ -13,6 +15,7 @@ pub struct RawTextContent { pub text: String, } pub type TextContent = Annotated; + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] @@ -56,8 +59,12 @@ pub type AudioContent = Annotated; pub enum RawContent { Text(RawTextContent), Image(RawImageContent), + /// Embedded resource payload Resource(RawEmbeddedResource), - Audio(AudioContent), + /// A link to a server resource that can be fetched on-demand + #[serde(rename = "resource_link")] + ResourceLink(super::resource::RawResource), + Audio(RawAudioContent), } pub type Content = Annotated; @@ -75,6 +82,11 @@ impl RawContent { Ok(RawContent::text(json)) } + /// Create a resource link content block + pub fn resource_link(link: super::resource::RawResource) -> Self { + RawContent::ResourceLink(link) + } + pub fn text>(text: S) -> Self { RawContent::Text(RawTextContent { text: text.into() }) } @@ -94,7 +106,7 @@ impl RawContent { RawContent::Resource(RawEmbeddedResource { resource: ResourceContents::TextResourceContents { uri: uri.into(), - mime_type: Some("text".to_string()), + mime_type: Some("text/plain".to_string()), text: content.into(), }, }) @@ -138,6 +150,10 @@ impl Content { RawContent::resource(resource).no_annotation() } + pub fn resource_link(link: super::resource::RawResource) -> Self { + RawContent::resource_link(link).no_annotation() + } + pub fn embedded_text, T: Into>(uri: S, content: T) -> Self { RawContent::embedded_text(uri, content).no_annotation() } @@ -207,4 +223,33 @@ mod tests { assert!(json.contains("mimeType")); assert!(!json.contains("mime_type")); } + + #[test] + fn test_resource_link_serialization() { + use crate::model::resource::RawResource; + + let link = RawResource { + uri: "file:///example.pdf".to_string(), + name: "Example PDF".to_string(), + description: Some("A test PDF".to_string()), + mime_type: Some("application/pdf".to_string()), + size: Some(1234), + }; + + let content = RawContent::resource_link(link); + let json = serde_json::to_string(&content).unwrap(); + + assert!(json.contains("\"type\":\"resource_link\"")); + assert!(json.contains("\"uri\":\"file:///example.pdf\"")); + assert!(json.contains("\"name\":\"Example PDF\"")); + assert!(json.contains("mimeType")); + assert!(!json.contains("mime_type")); + } + + #[test] + fn test_embedded_text_uses_text_plain() { + let content = RawContent::embedded_text("file:///example.txt", "hello"); + let json = serde_json::to_string(&content).unwrap(); + assert!(json.contains("\"mimeType\":\"text/plain\"")); + } } diff --git a/crates/rmcp/src/model/prompt.rs b/crates/rmcp/src/model/prompt.rs index 51293cd4..47245cd6 100644 --- a/crates/rmcp/src/model/prompt.rs +++ b/crates/rmcp/src/model/prompt.rs @@ -78,6 +78,12 @@ pub enum PromptMessageContent { }, /// Embedded server-side resource Resource { resource: EmbeddedResource }, + /// A link to a resource + #[serde(rename = "resource_link")] + ResourceLink { + #[serde(flatten)] + link: super::resource::Resource, + }, } impl PromptMessageContent { @@ -127,6 +133,20 @@ impl PromptMessage { } } + /// Create a new resource link message + pub fn new_resource_link( + role: PromptMessageRole, + link: super::resource::RawResource, + annotations: Option, + ) -> Self { + Self { + role, + content: PromptMessageContent::ResourceLink { + link: link.optional_annotate(annotations), + }, + } + } + /// Create a new resource message pub fn new_resource( role: PromptMessageRole, @@ -174,3 +194,13 @@ mod tests { assert!(!json.contains("mime_type")); } } + +#[test] +fn test_prompt_message_resource_link() { + use super::resource::RawResource; + let link = RawResource::new("file:///example.txt", "example"); + let msg = PromptMessage::new_resource_link(PromptMessageRole::Assistant, link, None); + let json = serde_json::to_string(&msg).unwrap(); + assert!(json.contains("\"type\":\"resource_link\"")); + assert!(json.contains("\"uri\":\"file:///example.txt\"")); +} 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 d11c105c..e488ecf2 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 @@ -101,6 +101,7 @@ ] }, { + "description": "Embedded resource payload", "type": "object", "properties": { "type": { @@ -118,47 +119,40 @@ ] }, { + "description": "A link to a server resource that can be fetched on-demand", "type": "object", "properties": { "type": { "type": "string", - "const": "audio" + "const": "resource_link" } }, "allOf": [ { - "$ref": "#/definitions/Annotated2" + "$ref": "#/definitions/RawResource" } ], "required": [ "type" ] - } - ] - }, - "Annotated2": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + } + }, + "allOf": [ { - "type": "null" + "$ref": "#/definitions/RawAudioContent" } + ], + "required": [ + "type" ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" } - }, - "required": [ - "data", - "mimeType" ] }, "Annotations": { @@ -872,6 +866,21 @@ "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" }, + "RawAudioContent": { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "data", + "mimeType" + ] + }, "RawEmbeddedResource": { "type": "object", "properties": { @@ -899,6 +908,47 @@ "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": { 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 new file mode 100644 index 00000000..e488ecf2 --- /dev/null +++ b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema_current.json @@ -0,0 +1,1406 @@ +{ + "$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" + ] + }, + { + "description": "Embedded resource payload", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "resource" + } + }, + "allOf": [ + { + "$ref": "#/definitions/RawEmbeddedResource" + } + ], + "required": [ + "type" + ] + }, + { + "description": "A link to a server resource that can be fetched on-demand", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "resource_link" + } + }, + "allOf": [ + { + "$ref": "#/definitions/RawResource" + } + ], + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + } + }, + "allOf": [ + { + "$ref": "#/definitions/RawAudioContent" + } + ], + "required": [ + "type" + ] + } + ] + }, + "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" + }, + "RawAudioContent": { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "data", + "mimeType" + ] + }, + "RawEmbeddedResource": { + "type": "object", + "properties": { + "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": { + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "required": [ + "uri", + "text" + ] + }, + { + "type": "object", + "properties": { + "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 c0b441c4..acfbae72 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 @@ -101,6 +101,7 @@ ] }, { + "description": "Embedded resource payload", "type": "object", "properties": { "type": { @@ -118,50 +119,43 @@ ] }, { + "description": "A link to a server resource that can be fetched on-demand", "type": "object", "properties": { "type": { "type": "string", - "const": "audio" + "const": "resource_link" } }, "allOf": [ { - "$ref": "#/definitions/Annotated2" + "$ref": "#/definitions/RawResource" } ], "required": [ "type" ] - } - ] - }, - "Annotated2": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + } + }, + "allOf": [ { - "type": "null" + "$ref": "#/definitions/RawAudioContent" } + ], + "required": [ + "type" ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" } - }, - "required": [ - "data", - "mimeType" ] }, - "Annotated3": { + "Annotated2": { "type": "object", "properties": { "annotations": { @@ -182,7 +176,7 @@ "resource" ] }, - "Annotated4": { + "Annotated3": { "description": "Represents a resource in the extension with metadata", "type": "object", "properties": { @@ -233,7 +227,7 @@ "name" ] }, - "Annotated5": { + "Annotated4": { "type": "object", "properties": { "annotations": { @@ -816,7 +810,7 @@ "resourceTemplates": { "type": "array", "items": { - "$ref": "#/definitions/Annotated5" + "$ref": "#/definitions/Annotated4" } } }, @@ -836,7 +830,7 @@ "resources": { "type": "array", "items": { - "$ref": "#/definitions/Annotated4" + "$ref": "#/definitions/Annotated3" } } }, @@ -1267,7 +1261,7 @@ "type": "object", "properties": { "resource": { - "$ref": "#/definitions/Annotated3" + "$ref": "#/definitions/Annotated2" }, "type": { "type": "string", @@ -1278,6 +1272,62 @@ "type", "resource" ] + }, + { + "description": "A link to a resource", + "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" + ] } ] }, @@ -1304,6 +1354,21 @@ "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" }, + "RawAudioContent": { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "data", + "mimeType" + ] + }, "RawEmbeddedResource": { "type": "object", "properties": { @@ -1331,6 +1396,47 @@ "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": { 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 index a0fa15e2..acfbae72 100644 --- 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 @@ -101,6 +101,7 @@ ] }, { + "description": "Embedded resource payload", "type": "object", "properties": { "type": { @@ -118,50 +119,43 @@ ] }, { + "description": "A link to a server resource that can be fetched on-demand", "type": "object", "properties": { "type": { "type": "string", - "const": "audio" + "const": "resource_link" } }, "allOf": [ { - "$ref": "#/definitions/Annotated2" + "$ref": "#/definitions/RawResource" } ], "required": [ "type" ] - } - ] - }, - "Annotated2": { - "type": "object", - "properties": { - "annotations": { - "anyOf": [ - { - "$ref": "#/definitions/Annotations" - }, + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "audio" + } + }, + "allOf": [ { - "type": "null" + "$ref": "#/definitions/RawAudioContent" } + ], + "required": [ + "type" ] - }, - "data": { - "type": "string" - }, - "mimeType": { - "type": "string" } - }, - "required": [ - "data", - "mimeType" ] }, - "Annotated3": { + "Annotated2": { "type": "object", "properties": { "annotations": { @@ -182,7 +176,7 @@ "resource" ] }, - "Annotated4": { + "Annotated3": { "description": "Represents a resource in the extension with metadata", "type": "object", "properties": { @@ -233,7 +227,7 @@ "name" ] }, - "Annotated5": { + "Annotated4": { "type": "object", "properties": { "annotations": { @@ -304,10 +298,7 @@ "properties": { "content": { "description": "The content returned by the tool (text, images, etc.)", - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/definitions/Annotated" } @@ -322,7 +313,10 @@ "structuredContent": { "description": "An optional JSON object that represents the structured result of the tool call" } - } + }, + "required": [ + "content" + ] }, "CancelledNotificationMethod": { "type": "string", @@ -405,6 +399,45 @@ } ] }, + "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", @@ -483,6 +516,31 @@ "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" @@ -686,6 +744,9 @@ }, { "$ref": "#/definitions/RequestNoParam2" + }, + { + "$ref": "#/definitions/Request2" } ], "required": [ @@ -749,7 +810,7 @@ "resourceTemplates": { "type": "array", "items": { - "$ref": "#/definitions/Annotated5" + "$ref": "#/definitions/Annotated4" } } }, @@ -769,7 +830,7 @@ "resources": { "type": "array", "items": { - "$ref": "#/definitions/Annotated4" + "$ref": "#/definitions/Annotated3" } } }, @@ -1200,7 +1261,7 @@ "type": "object", "properties": { "resource": { - "$ref": "#/definitions/Annotated3" + "$ref": "#/definitions/Annotated2" }, "type": { "type": "string", @@ -1211,6 +1272,62 @@ "type", "resource" ] + }, + { + "description": "A link to a resource", + "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" + ] } ] }, @@ -1237,6 +1354,21 @@ "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" }, + "RawAudioContent": { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "data", + "mimeType" + ] + }, "RawEmbeddedResource": { "type": "object", "properties": { @@ -1264,6 +1396,47 @@ "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": { @@ -1307,6 +1480,22 @@ "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": { @@ -1546,6 +1735,9 @@ { "$ref": "#/definitions/ListToolsResult" }, + { + "$ref": "#/definitions/CreateElicitationResult" + }, { "$ref": "#/definitions/EmptyObject" } From 44f54b7093abf4dc978cf498325b908fc2c4eeaf Mon Sep 17 00:00:00 2001 From: Andrew Harvard Date: Fri, 22 Aug 2025 16:02:04 -0400 Subject: [PATCH 2/2] fix(rmcp): correct grammar in content.rs documentation Change 'can be display' to 'can be displayed' in module documentation --- crates/rmcp/src/model/content.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rmcp/src/model/content.rs b/crates/rmcp/src/model/content.rs index a56f7241..d8fcbcb3 100644 --- a/crates/rmcp/src/model/content.rs +++ b/crates/rmcp/src/model/content.rs @@ -1,7 +1,7 @@ //! Content sent around agents, extensions, and LLMs //! NOTE: This file models MCP ContentBlock union types. Keep in sync with MCP draft schema. -//! The various content types can be display to humans but also understood by models +//! The various content types can be displayed to humans but also understood by models //! They include optional annotations used to help inform agent usage use serde::{Deserialize, Serialize}; use serde_json::json;