Kuberwastaken/claurst · error
rmcp list_resources failed
Error message
rmcp list_resources failed: {} What it means
Raised in `RmcpClientBackend::list_resources` when the rmcp peer's `list_all_resources()` future fails during the `resources/list` round-trip. Like the other rmcp peer wrappers, any transport failure or JSON-RPC error response from the MCP server is re-wrapped with a uniform message so the caller sees which backend operation failed. The original rmcp error text follows the colon.
Solutions
- Check the inner error: 'method not found' means the server has no resources capability — treat the list as empty.
- Reconnect the MCP session and retry if the transport/session closed.
- Verify the server advertises the resources capability in its initialize response.
- Check server-side logs if the enumeration itself failed.
Example fix
// before: unconditional listing
let resources = backend.list_resources().await?;
// after: tolerate servers without the resources capability
let resources = match backend.list_resources().await {
Ok(r) => r,
Err(e) if e.to_string().contains("method not found") => Vec::new(),
Err(e) => return Err(e),
}; Defensive patterns
Strategy: try-catch
Validate before calling
fn server_supports_resources(init_caps: &ServerCapabilities) -> bool {
init_caps.resources.is_some()
} Try / catch
match backend.list_resources().await {
Ok(resources) => resources,
Err(e) if e.to_string().contains("method not found") => Vec::new(),
Err(e) => return Err(e.into()),
} Prevention
- Check the resources capability in the initialize response before listing.
- Reconnect the backend if the server restarted; stale sessions fail every call.
- Treat 'method not found' as an empty capability, not an outage.
- Check server logs when enumeration fails despite advertised capability.
When it happens
Trigger: Calling `list_resources` when the server rejects `resources/list`: server lacks the resources capability (JSON-RPC 'method not found'), the session is closed or stale, the transport failed mid-request, or the server errored enumerating its resources.
Common situations: Connecting to an MCP server that only exposes tools (very common — many servers skip resources); server restarted between connect and the listing call; legacy SSE endpoint no longer valid; a resource provider on the server side panicking during enumeration.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- rmcp list_tools failed
- rmcp read_resource ' ' failed
- rmcp list_prompts failed
- rmcp call_tool ' ' failed
- rmcp read_resource ' ' returned no contents
AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10).
Data as JSON: /api/errors/69eed04f3f36f994.
Report an issue: GitHub.
Appendix: source
Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:534
) -> anyhow::Result<CallToolResult> {
let mut params = rmcp_model::CallToolRequestParams::new(name.to_string());
if let Some(arguments) = arguments {
params = params.with_arguments(json_value_to_object(arguments)?);
}
let result = self
.peer
.call_tool(params)
.await
.map_err(|e| anyhow::anyhow!("rmcp call_tool '{}' failed: {}", name, e))?;
Ok(convert_call_tool_result(result))
}
async fn list_resources(&self) -> anyhow::Result<Vec<McpResource>> {
let resources = self
.peer
.list_all_resources()
.await
.map_err(|e| anyhow::anyhow!("rmcp list_resources failed: {}", e))?;
Ok(resources.into_iter().map(convert_resource).collect())
}
async fn read_resource(&self, uri: &str) -> anyhow::Result<ResourceContents> {
let result = self
.peer
.read_resource(rmcp_model::ReadResourceRequestParams::new(uri.to_string()))
.await
.map_err(|e| anyhow::anyhow!("rmcp read_resource '{}' failed: {}", uri, e))?;
let first = result
.contents
.into_iter()
.next()
.ok_or_else(|| anyhow::anyhow!("rmcp read_resource '{}' returned no contents", uri))?;
Ok(convert_resource_contents(first))
}
async fn list_prompts(&self) -> anyhow::Result<Vec<McpPrompt>> {View on GitHub (pinned to b0637c97ec)