{"record":{"id":"68acce995ceba2bf","repo":"tinyhumansai/openhuman","slug":"mcp-tools-list-response-missing-tools","errorCode":null,"errorMessage":"MCP tools/list response missing `tools`","messagePattern":"MCP tools/list response missing `tools`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/mcp/http_client/client.rs","lineNumber":318,"sourceCode":"\n        Ok(init)\n    }\n\n    pub async fn list_tools(&self) -> anyhow::Result<Vec<McpRemoteTool>> {\n        self.initialize().await?;\n        let result = self\n            .send_jsonrpc(\n                \"tools/list\",\n                json!({}),\n                RequestOptions::standard(\"tools/list\", None, None),\n            )\n            .await?\n            .result;\n        let tools = serde_json::from_value::<Vec<McpRemoteTool>>(\n            result\n                .get(\"tools\")\n                .cloned()\n                .ok_or_else(|| anyhow::anyhow!(\"MCP tools/list response missing `tools`\"))?,\n        )?;\n        let mut state = self.state.lock();\n        state.cached_tools = tools\n            .iter()\n            .cloned()\n            .map(|tool| (tool.name.clone(), tool))\n            .collect();\n        Ok(tools)\n    }\n\n    pub async fn call_tool(\n        &self,\n        name: &str,\n        arguments: Value,\n    ) -> anyhow::Result<McpServerToolResult> {\n        self.initialize().await?;\n        let cached_tool = { self.state.lock().cached_tools.get(name).cloned() };\n        let tool = if let Some(tool) = cached_tool {","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/mcp/http_client/client.rs#L300-L336","documentation":"The HTTP MCP server's tools/list reply succeeded at the JSON-RPC layer but its result object lacked the \"tools\" array. The server responded to the wrong shape or returned an empty object — a server-side protocol violation.","triggerScenarios":"Thrown at src/openhuman/mcp/http_client/client.rs:318 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Capture and inspect the raw result object to see what the server returned","Verify the server's MCP protocol version matches LATEST_PROTOCOL_VERSION sent in initialize","Report or upgrade the remote server if it never populates tools"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}