Kuberwastaken/claurst · error

rmcp tool arguments must be a JSON object, got

Error message

rmcp tool arguments must be a JSON object, got {}

What it means

Type-guard failure when converting tool-call arguments for an MCP tool invocation: the arguments Value is not a JSON object (it is an array, string, number, null, etc.). The rmcp transport requires a JsonObject; a caller supplied malformed arguments to call_tool.

Solutions

  1. Pass tool arguments as a JSON object with string keys
  2. Fix the caller constructing the tool request to shape arguments as an object
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:834 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/db7821d0fb32d449. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:834

        rmcp_model::RawContent::ResourceLink(link) => McpContent::Resource {
            resource: ResourceContents {
                uri: link.uri,
                mime_type: link.mime_type,
                text: None,
                blob: None,
            },
        },
        rmcp_model::RawContent::Audio(audio) => McpContent::Text {
            text: format!("[Audio: {} | base64 bytes omitted]", audio.mime_type),
        },
    }
}


fn json_value_to_object(value: Value) -> anyhow::Result<rmcp_model::JsonObject> {
    match value {
        Value::Object(map) => Ok(map),
        other => Err(anyhow::anyhow!(
            "rmcp tool arguments must be a JSON object, got {}",
            other
        )),
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use claurst_core::config::McpServerConfig;
    use tokio::io::{AsyncReadExt, AsyncWriteExt};
    use tokio::net::TcpListener;
    use tokio::time::{Duration, timeout};

    fn test_sse_config(url: String) -> McpServerConfig {
        McpServerConfig {
            name: "test-sse".to_string(),
            command: None,

View on GitHub (pinned to b0637c97ec)