{"record":{"id":"f2c6ca2b4eb1be8f","repo":"Kuberwastaken/claurst","slug":"rmcp-list-tools-failed","errorCode":null,"errorMessage":"rmcp list_tools failed: {}","messagePattern":"rmcp list_tools failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/mcp/src/rmcp_backend.rs","lineNumber":508,"sourceCode":"    Ok(())\n}\n\n#[async_trait]\nimpl McpClientBackend for RmcpClientBackend {\n    fn kind(&self) -> McpBackendKind {\n        McpBackendKind::Rmcp\n    }\n\n    fn snapshot(&self) -> McpClientSnapshot {\n        self.snapshot.clone()\n    }\n\n    async fn list_tools(&self) -> anyhow::Result<Vec<McpTool>> {\n        let tools = self\n            .peer\n            .list_all_tools()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"rmcp list_tools failed: {}\", e))?;\n        Ok(tools.into_iter().map(convert_tool).collect())\n    }\n\n    async fn call_tool(\n        &self,\n        name: &str,\n        arguments: Option<Value>,\n    ) -> anyhow::Result<CallToolResult> {\n        let mut params = rmcp_model::CallToolRequestParams::new(name.to_string());\n        if let Some(arguments) = arguments {\n            params = params.with_arguments(json_value_to_object(arguments)?);\n        }\n        let result = self\n            .peer\n            .call_tool(params)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"rmcp call_tool '{}' failed: {}\", name, e))?;\n        Ok(convert_call_tool_result(result))","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/mcp/src/rmcp_backend.rs#L490-L526","documentation":"Raised in `RmcpClientBackend::list_tools` when the underlying rmcp peer's `list_all_tools()` future fails. The rmcp peer round-trips a `tools/list` JSON-RPC request to the MCP server; any failure — transport error, JSON-RPC error response from the server, timeout, or a closed session — is surfaced here with a uniform `rmcp list_tools failed: <cause>` message. The original rmcp error is preserved after the colon.","triggerScenarios":"Calling `McpClientBackend::list_tools` on an rmcp backend when the server rejects `tools/list`: server does not support the tools capability, session was closed/restarted, transport send/receive failed, or the server returned a JSON-RPC error (e.g. -32601 method not found).","commonSituations":"MCP server that implements only prompts/resources but not tools; server restarted between connect and list; legacy SSE endpoint stale after reconnect; server-side timeout on a very large tool listing; user runs an /mcp tools command against a misconfigured server.","solutions":["Read the inner error: 'method not found' means the server lacks tools support; 'transport closed' means reconnect.","Reconnect the MCP backend (restart the session) and retry list_tools.","Verify the MCP server actually implements the `tools` capability (check its docs/capabilities line at startup).","If the session is stale (server restarted), recreate the client instead of reusing the old peer handle."],"exampleFix":"// before: assuming tools always exist\nlet tools = backend.list_tools().await?;\n// after: degrade gracefully when the server has no tools capability\nlet tools = match backend.list_tools().await {\n    Ok(t) => t,\n    Err(e) if e.to_string().contains(\"method not found\") => Vec::new(),\n    Err(e) => return Err(e),\n};","handlingStrategy":"try-catch","validationCode":"fn server_supports_tools(init_caps: &ServerCapabilities) -> bool {\n    init_caps.tools.is_some()\n}","typeGuard":null,"tryCatchPattern":"match backend.list_tools().await {\n    Ok(tools) => tools,\n    Err(e) if e.to_string().contains(\"method not found\") => Vec::new(),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Inspect the server's initialize capabilities and only call list_tools when tools are advertised.","Recreate the backend after any MCP server restart; a stale peer handle fails all calls.","Cache the tool list with a TTL instead of re-listing constantly.","Read the inner rmcp error before retrying — capability errors are permanent, transport errors are not."],"tags":["mcp","jsonrpc","tools","rpc","session"],"backgroundTag":"api-request-failed","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}