feat!: align model types with MCP 2025-11-25 spec (#927)

* feat!: align model types with MCP 2025-11-25 spec

* fix: complete 2025-11-25 model spec conformance
This commit is contained in:
Dale Seo 2026-06-24 20:41:13 -04:00 • committed by GitHub
commit 77932141e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,7 +3,7 @@
use rmcp::{
Json, ServerHandler,
handler::server::{router::tool::ToolRouter, tool::IntoCallToolResult, wrapper::Parameters},
model::{CallToolResult, Content, ServerResult, Tool},
model::{CallToolResult, ContentBlock, ServerResult, Tool},
tool, tool_handler, tool_router,
};
use schemars::JsonSchema;
@ -192,7 +192,8 @@ async fn test_mutual_exclusivity_validation() {
message: "Hello".into(),
};
// Test that content and structured_content can both be passed separately
let content_result = CallToolResult::success(vec![Content::json(response.clone()).unwrap()]);
let content_result =
CallToolResult::success(vec![ContentBlock::json(response.clone()).unwrap()]);
let structured_result = CallToolResult::structured(json!({"message": "Hello"}));
// Verify the validation