diff --git a/crates/rmcp/src/model.rs b/crates/rmcp/src/model.rs index e0f0bb24..3c86fbbd 100644 --- a/crates/rmcp/src/model.rs +++ b/crates/rmcp/src/model.rs @@ -2045,6 +2045,7 @@ impl RequestParamsMeta for CancelTaskParams { pub type CancelTaskParam = CancelTaskParams; #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(rename_all = "camelCase")] +#[serde(deny_unknown_fields)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] pub struct GetTaskInfoResult { #[serde(skip_serializing_if = "Option::is_none")] @@ -2130,11 +2131,11 @@ ts_union!( | UnsubscribeRequest | CallToolRequest | ListToolsRequest - | CustomRequest | GetTaskInfoRequest | ListTasksRequest | GetTaskResultRequest - | CancelTaskRequest; + | CancelTaskRequest + | CustomRequest; ); impl ClientRequest { @@ -2153,11 +2154,11 @@ impl ClientRequest { ClientRequest::UnsubscribeRequest(r) => r.method.as_str(), ClientRequest::CallToolRequest(r) => r.method.as_str(), ClientRequest::ListToolsRequest(r) => r.method.as_str(), - ClientRequest::CustomRequest(r) => r.method.as_str(), ClientRequest::GetTaskInfoRequest(r) => r.method.as_str(), ClientRequest::ListTasksRequest(r) => r.method.as_str(), ClientRequest::GetTaskResultRequest(r) => r.method.as_str(), ClientRequest::CancelTaskRequest(r) => r.method.as_str(), + ClientRequest::CustomRequest(r) => r.method.as_str(), } } } @@ -2222,11 +2223,11 @@ ts_union!( | ListToolsResult | CreateElicitationResult | EmptyResult - | CustomResult | CreateTaskResult | ListTasksResult | GetTaskInfoResult | TaskResult + | CustomResult ; ); 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 e0d90fa8..6e45c5f1 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 @@ -862,9 +862,6 @@ { "$ref": "#/definitions/RequestOptionalParam4" }, - { - "$ref": "#/definitions/CustomRequest" - }, { "$ref": "#/definitions/Request9" }, @@ -876,6 +873,9 @@ }, { "$ref": "#/definitions/Request11" + }, + { + "$ref": "#/definitions/CustomRequest" } ], "required": [ 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 index e0d90fa8..6e45c5f1 100644 --- 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 @@ -862,9 +862,6 @@ { "$ref": "#/definitions/RequestOptionalParam4" }, - { - "$ref": "#/definitions/CustomRequest" - }, { "$ref": "#/definitions/Request9" }, @@ -876,6 +873,9 @@ }, { "$ref": "#/definitions/Request11" + }, + { + "$ref": "#/definitions/CustomRequest" } ], "required": [ 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 b848d4ee..f1596857 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 @@ -857,7 +857,8 @@ } ] } - } + }, + "additionalProperties": false }, "Icon": { "description": "A URL pointing to an icon resource or a base64-encoded data URI.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)", @@ -2452,9 +2453,6 @@ { "$ref": "#/definitions/EmptyObject" }, - { - "$ref": "#/definitions/CustomResult" - }, { "$ref": "#/definitions/CreateTaskResult" }, @@ -2466,6 +2464,9 @@ }, { "$ref": "#/definitions/TaskResult" + }, + { + "$ref": "#/definitions/CustomResult" } ] }, 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 b848d4ee..f1596857 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 @@ -857,7 +857,8 @@ } ] } - } + }, + "additionalProperties": false }, "Icon": { "description": "A URL pointing to an icon resource or a base64-encoded data URI.\n\nClients that support rendering icons MUST support at least the following MIME types:\n- image/png - PNG images (safe, universal compatibility)\n- image/jpeg (and image/jpg) - JPEG images (safe, universal compatibility)\n\nClients that support rendering icons SHOULD also support:\n- image/svg+xml - SVG images (scalable but requires security precautions)\n- image/webp - WebP images (modern, efficient format)", @@ -2452,9 +2453,6 @@ { "$ref": "#/definitions/EmptyObject" }, - { - "$ref": "#/definitions/CustomResult" - }, { "$ref": "#/definitions/CreateTaskResult" }, @@ -2466,6 +2464,9 @@ }, { "$ref": "#/definitions/TaskResult" + }, + { + "$ref": "#/definitions/CustomResult" } ] },