Skip to content

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

feat(mcp): accept string-encoded tool arguments

Steven Enamakelb06e73322392
diff --git a/crates/openhuman-core/src/tools/impl/network/mcp.rs b/crates/openhuman-core/src/tools/impl/network/mcp.rs
index 7e574776f6..917d232f55 100644
--- a/crates/openhuman-core/src/tools/impl/network/mcp.rs
+++ b/crates/openhuman-core/src/tools/impl/network/mcp.rs
@@ -260,9 +260,12 @@ impl Tool for McpCallTool {
.get("arguments")
.cloned()
.ok_or_else(|| anyhow::anyhow!("missing required `arguments` object"))?;
- if !arguments.is_object() {
- return Ok(ToolResult::error("`arguments` must be an object"));
- }
+ // An object JSON-encoded into a string is decoded; anything that
+ // cannot hold one is refused naming what arrived.
+ let arguments = match tinymcp_bus::normalize_tool_arguments(arguments) {
+ Ok(arguments) => Value::Object(arguments),
+ Err(error) => return Ok(ToolResult::error(format!("`arguments`: {error}"))),
+ };
let scrubber = SecretScrubber::for_server(&self.registry, &server);
let mut result = match self.registry.call_tool(&server, &tool, arguments).await {