Skip to content

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

refactor(mcp): accept optional tool arguments in normalize_tool_arguments

Steven Enamakela61e5da9e239
diff --git a/crates/openhuman-core/src/mcp/module_client.rs b/crates/openhuman-core/src/mcp/module_client.rs
index 9ed66a32e5..7ba7b72d37 100644
--- a/crates/openhuman-core/src/mcp/module_client.rs
+++ b/crates/openhuman-core/src/mcp/module_client.rs
@@ -443,12 +443,12 @@ impl McpConfiguredClient {
/// implementation operation.
pub(crate) async fn normalize_tool_arguments(
&self,
- arguments: Value,
+ arguments: Option<Value>,
) -> Result<Map<String, Value>, ModuleCallError> {
if SHUTTING_DOWN.load(Ordering::Acquire) {
return Err(ModuleCallError::Unavailable);
}
- self.port.normalize_tool_arguments(Some(arguments)).await
+ self.port.normalize_tool_arguments(arguments).await
}
/// Normalizes a model-supplied MCP identifier in TinyMCP.
diff --git a/crates/openhuman-core/src/tools/impl/network/mcp.rs b/crates/openhuman-core/src/tools/impl/network/mcp.rs
index c6e5ec9745..b9ca737b30 100644
--- a/crates/openhuman-core/src/tools/impl/network/mcp.rs
+++ b/crates/openhuman-core/src/tools/impl/network/mcp.rs
@@ -372,7 +372,7 @@ impl Tool for McpCallTool {
.cloned()
.ok_or_else(|| anyhow::anyhow!("missing MCP tool arguments"))?;
let arguments = client
- .normalize_tool_arguments(arguments)
+ .normalize_tool_arguments(Some(arguments))
.await
.map_err(|error| anyhow::anyhow!(input_module_error_message(error)))?;
Ok(Some(call.with_arguments(Value::Object(arguments))))
@@ -431,8 +431,7 @@ impl Tool for McpCallTool {
));
}
};
- let client_config = host::client_config(&self.config);
- let arguments = match client.normalize_tool_arguments(arguments).await {
+ let arguments = match client.normalize_tool_arguments(Some(arguments)).await {
Ok(arguments) => Value::Object(arguments),
Err(error) => {
let outcome = tinymcp_bus::McpCallOutcome::failed(
diff --git a/crates/openhuman-core/src/tools/impl/network/mcp_server_tools.rs b/crates/openhuman-core/src/tools/impl/network/mcp_server_tools.rs
index 7caeff57b5..64fbf12b8b 100644
--- a/crates/openhuman-core/src/tools/impl/network/mcp_server_tools.rs
+++ b/crates/openhuman-core/src/tools/impl/network/mcp_server_tools.rs
@@ -148,7 +148,7 @@ impl Tool for ModuleConfiguredMcpServerTool {
anyhow::bail!("MCP tool is no longer available or safe");
}
let arguments = client
- .normalize_tool_arguments(args)
+ .normalize_tool_arguments(Some(args))
.await
.map_err(|error| anyhow::anyhow!(super::mcp::input_module_error_message(error)))?;
let call: tinymcp_bus::ClassifiedStaticToolCall = client