Skip to content

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

fix(registry): correct schema parameter type for tool input

Steven Enamakelb64ee4adbda9
diff --git a/crates/openhuman-core/src/mcp/registry/schemas/params.rs b/crates/openhuman-core/src/mcp/registry/schemas/params.rs
index 0f1739a972..2628b7b2c4 100644
--- a/crates/openhuman-core/src/mcp/registry/schemas/params.rs
+++ b/crates/openhuman-core/src/mcp/registry/schemas/params.rs
@@ -1,36 +1,13 @@
//! Shared param-deserialisation and outcome-conversion helpers used by
//! every `mcp_clients_*` and `mcp_setup_*` handler.
-use serde::de::DeserializeOwned;
use serde_json::{Map, Value};
use crate::rpc::RpcOutcome;
+use crate::util::{read_optional, read_required};
// ── Param helpers ─────────────────────────────────────────────────────────────
-pub(super) fn read_required<T: DeserializeOwned>(
- params: &Map<String, Value>,
- key: &str,
-) -> Result<T, String> {
- let value = params
- .get(key)
- .cloned()
- .ok_or_else(|| format!("missing required param '{key}'"))?;
- serde_json::from_value(value).map_err(|e| format!("invalid '{key}': {e}"))
-}
-
-pub(super) fn read_optional<T: DeserializeOwned>(
- params: &Map<String, Value>,
- key: &str,
-) -> Result<Option<T>, String> {
- match params.get(key) {
- None | Some(Value::Null) => Ok(None),
- Some(v) => serde_json::from_value(v.clone())
- .map(Some)
- .map_err(|e| format!("invalid '{key}': {e}")),
- }
-}
-
pub(super) fn read_optional_string(
params: &Map<String, Value>,
key: &str,