Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(mcp): preserve tool annotations in configured client

Steven Enamakel3571b9623c66
diff --git a/crates/openhuman-core/src/mcp/module_client.rs b/crates/openhuman-core/src/mcp/module_client.rs
index 4b14613501..d5bedcb5b4 100644
--- a/crates/openhuman-core/src/mcp/module_client.rs
+++ b/crates/openhuman-core/src/mcp/module_client.rs
@@ -263,6 +263,7 @@ impl McpConfiguredClient {
description: tool.description,
input_schema: tool.input_schema,
meta: None,
+ annotations: None,
})
.collect(),
None => {
diff --git a/crates/openhuman-core/src/mcp/module_client_tests.rs b/crates/openhuman-core/src/mcp/module_client_tests.rs
index 0a97144bfb..83d7442b5b 100644
--- a/crates/openhuman-core/src/mcp/module_client_tests.rs
+++ b/crates/openhuman-core/src/mcp/module_client_tests.rs
@@ -289,6 +289,7 @@ async fn static_tool_metadata_scrubbing_uses_confidential_module_delivery() {
description: Some("Search docs".to_owned()),
input_schema: serde_json::json!({"type":"object"}),
meta: Some(serde_json::json!({"ui":{"resourceUri":"ui://search"}})),
+ annotations: Some(serde_json::json!({"readOnlyHint": true, "openWorldHint": false})),
};
let returned = client
@@ -302,6 +303,10 @@ async fn static_tool_metadata_scrubbing_uses_confidential_module_delivery() {
assert_eq!(calls[0].1, names::methods::STATIC_SCRUB_TOOLS);
assert_eq!(calls[0].2[0]["server"], "docs");
assert_eq!(calls[0].2[0]["tools"][0]["name"], "search");
+ assert_eq!(
+ calls[0].2[0]["tools"][0]["annotations"],
+ serde_json::json!({"readOnlyHint": true, "openWorldHint": false})
+ );
assert!(calls[0].3, "raw remote metadata must cross confidentially");
}