From 07028bc0aa5f4962a5c2250e6bbd1707033ac7ae Mon Sep 17 00:00:00 2001 From: Dale Seo <5466341+DaleSeo@users.noreply.github.com> Date: Tue, 10 Feb 2026 08:36:47 -0500 Subject: [PATCH] Add optional description field to Implementation struct (#649) * feat: add optional description field to Implementation struct * test: update snapshots --- crates/rmcp/src/model.rs | 7 +++++++ crates/rmcp/tests/test_elicitation.rs | 3 +++ .../client_json_rpc_message_schema.json | 6 ++++++ .../client_json_rpc_message_schema_current.json | 6 ++++++ .../server_json_rpc_message_schema.json | 6 ++++++ .../server_json_rpc_message_schema_current.json | 6 ++++++ examples/clients/src/streamable_http.rs | 1 + 7 files changed, 35 insertions(+) diff --git a/crates/rmcp/src/model.rs b/crates/rmcp/src/model.rs index 16ccc0a..00c51bc 100644 --- a/crates/rmcp/src/model.rs +++ b/crates/rmcp/src/model.rs @@ -841,6 +841,8 @@ pub struct Implementation { pub title: Option, pub version: String, #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub icons: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub website_url: Option, @@ -858,6 +860,7 @@ impl Implementation { name: env!("CARGO_CRATE_NAME").to_owned(), title: None, version: env!("CARGO_PKG_VERSION").to_owned(), + description: None, icons: None, website_url: None, } @@ -3136,6 +3139,7 @@ mod tests { name: "test-server".to_string(), title: Some("Test Server".to_string()), version: "1.0.0".to_string(), + description: Some("A test server for unit testing".to_string()), icons: Some(vec![ Icon { src: "https://example.com/icon.png".to_string(), @@ -3153,6 +3157,7 @@ mod tests { let json = serde_json::to_value(&implementation).unwrap(); assert_eq!(json["name"], "test-server"); + assert_eq!(json["description"], "A test server for unit testing"); assert_eq!(json["websiteUrl"], "https://example.com"); assert!(json["icons"].is_array()); assert_eq!(json["icons"][0]["src"], "https://example.com/icon.png"); @@ -3172,6 +3177,7 @@ mod tests { let implementation: Implementation = serde_json::from_value(old_json).unwrap(); assert_eq!(implementation.name, "legacy-server"); assert_eq!(implementation.version, "0.9.0"); + assert_eq!(implementation.description, None); assert_eq!(implementation.icons, None); assert_eq!(implementation.website_url, None); } @@ -3185,6 +3191,7 @@ mod tests { name: "icon-server".to_string(), title: None, version: "2.0.0".to_string(), + description: None, icons: Some(vec![Icon { src: "https://example.com/server.png".to_string(), mime_type: Some("image/png".to_string()), diff --git a/crates/rmcp/tests/test_elicitation.rs b/crates/rmcp/tests/test_elicitation.rs index 3cc3c0d..ce8be28 100644 --- a/crates/rmcp/tests/test_elicitation.rs +++ b/crates/rmcp/tests/test_elicitation.rs @@ -1112,6 +1112,7 @@ async fn test_initialize_request_with_elicitation() { name: "test-client".to_string(), version: "1.0.0".to_string(), title: None, + description: None, website_url: None, icons: None, }, @@ -1163,6 +1164,7 @@ async fn test_capability_checking_logic() { name: "test-client".to_string(), version: "1.0.0".to_string(), title: None, + description: None, website_url: None, icons: None, }, @@ -1184,6 +1186,7 @@ async fn test_capability_checking_logic() { name: "test-client".to_string(), version: "1.0.0".to_string(), title: None, + description: None, website_url: None, icons: None, }, 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 c7a2092..940f03f 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 @@ -729,6 +729,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", 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 c7a2092..940f03f 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 @@ -729,6 +729,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", 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 2986077..f0b6173 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 @@ -986,6 +986,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", 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 2986077..f0b6173 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 @@ -986,6 +986,12 @@ "Implementation": { "type": "object", "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, "icons": { "type": [ "array", diff --git a/examples/clients/src/streamable_http.rs b/examples/clients/src/streamable_http.rs index 7af9b5b..baf1838 100644 --- a/examples/clients/src/streamable_http.rs +++ b/examples/clients/src/streamable_http.rs @@ -25,6 +25,7 @@ async fn main() -> Result<()> { name: "test sse client".to_string(), title: None, version: "0.0.1".to_string(), + description: None, website_url: None, icons: None, },