Skip to content

Commit 5138711

Browse files
committed
Update to rmcp 1.2.0
1 parent 9569a52 commit 5138711

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tracing-appender = "0.2"
3939
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
4040

4141
# MCP SDK
42-
rmcp = { version = "1.0.0-alpha", features = ["server", "transport-io", "schemars"] }
42+
rmcp = { version = "1.2.0", features = ["server", "transport-io", "schemars"] }
4343

4444
# CLI parsing
4545
clap = { version = "4.5", features = ["derive"] }

src/sacp/src/mcp_server/builder.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -510,21 +510,21 @@ trait ErasedMcpTool<Counterpart: Role>: Send + Sync {
510510

511511
/// Create an `rmcp` tool model from our [`McpTool`] trait.
512512
fn make_tool_model<R: Role, M: McpTool<R>>(tool: &M) -> Tool {
513-
{
514-
rmcp::model::Tool::new(
515-
tool.name(),
516-
tool.description(),
517-
schema_for_type::<M::Input>(),
518-
)
513+
let mut tool = rmcp::model::Tool::new(
514+
tool.name(),
515+
tool.description(),
516+
schema_for_type::<M::Input>(),
517+
)
518+
.with_execution(rmcp::model::ToolExecution::new());
519+
520+
if let Some(schema) = schema_for_output::<M::Output>().ok() {
519521
// schema_for_output returns Err for non-object types (strings, integers, etc.)
520-
// since MCP structured output requires JSON objects. We use .ok() to set
522+
// since MCP structured output requires JSON objects. We set
521523
// output_schema to None for these tools, signaling unstructured output.
522-
.with_raw_output_schema(schema_for_output::<M::Output>().ok())
523-
.with_annotations(None)
524-
.with_icons(None)
525-
.with_meta(None)
526-
.with_execution(Some(rmcp::model::ToolExecution::new()))
524+
tool = tool.with_raw_output_schema(schema);
527525
}
526+
527+
tool
528528
}
529529

530530
/// Create a [`ErasedMcpTool`] from a [`McpTool`], erasing the type details.

0 commit comments

Comments
 (0)