{"record":{"id":"123bc62bbeee2dcb","repo":"zeroclaw-labs/zeroclaw","slug":"mcp-server-does-not-support-resources","errorCode":null,"errorMessage":"MCP server `{}` does not support resources","messagePattern":"MCP server `(.+?)` does not support resources","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/zeroclaw-tools/src/mcp_client.rs","lineNumber":795,"sourceCode":"        let resp = self\n            .dispatch_rpc(rpc_method, params, tool_timeout, &operation)\n            .await?;\n\n        if let Some(err) = resp.error {\n            bail!(\"MCP `{rpc_method}` error {}: {}\", err.code, err.message);\n        }\n        let result = resp.result.unwrap_or(serde_json::Value::Null);\n        let server_name = self.inner.lock().await.config.name.clone();\n        check_result_is_error(&result, rpc_method, &server_name)?;\n        Ok(result)\n    }\n\n    /// `resources/list` — capability-gated.\n    pub async fn list_resources(&self, cursor: Option<String>) -> Result<McpResourcesListResult> {\n        {\n            let inner = self.inner.lock().await;\n            if !inner.capabilities.supports_resources() {\n                bail!(\n                    \"MCP server `{}` does not support resources\",\n                    inner.config.name\n                );\n            }\n        }\n        let params = match cursor {\n            Some(c) => json!({ \"cursor\": c }),\n            None => json!({}),\n        };\n        let raw = self.dispatch_method(\"resources/list\", params).await?;\n        serde_json::from_value(raw).context(\"failed to parse resources/list result\")\n    }\n\n    /// `resources/read` — capability-gated.\n    pub async fn read_resource(&self, uri: &str) -> Result<McpResourceContents> {\n        {\n            let inner = self.inner.lock().await;\n            if !inner.capabilities.supports_resources() {","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-tools/src/mcp_client.rs#L777-L813","documentation":"list_resources is capability-gated: the server's initialize response did not advertise the resources capability, so the client refuses to send resources/list rather than let the server error downstream. The gate reads the capabilities parsed during handshake, so it reflects exactly what this server build declared.","triggerScenarios":"Configuring a tools-only or prompts-only MCP server (no resources in its initialize result) and calling list_resources; a proxy that strips capability fields from the initialize result; older server builds predating the resources part of the protocol.","commonSituations":"Pointing generic resource-walking code at specialized tool servers; version drift where the deployed server build dropped resource support.","solutions":["Switch to an MCP server that advertises resources (e.g. a filesystem server) if you need them","Check the server's initialize response or client debug logs to confirm which capabilities it actually declared","Guard resource calls so unsupported servers are skipped instead of erroring the whole flow","If the server should support resources, change to a build that declares them"],"exampleFix":"// before\nlet res = client.list_resources(None).await?;\n\n// after: skip servers without the capability\nmatch client.list_resources(None).await {\n    Ok(res) => handle(res),\n    Err(e) if is_unsupported_resources(&e) => skip_server(&name),\n    Err(e) => return Err(e),\n}","handlingStrategy":"validation","validationCode":"// Probe once per server and cache the result instead of failing per call\nlet supports = match client.list_resources(None).await {\n    Ok(_) => true,\n    Err(e) if is_unsupported_resources(&e) => false,\n    Err(e) => return Err(e),\n};\nif supports {\n    walk_resources(&client).await?;\n}","typeGuard":"fn is_unsupported_resources(err: &anyhow::Error) -> bool {\n    err.to_string().contains(\"does not support resources\")\n}","tryCatchPattern":"Catch and treat as a capability signal, not a fault: skip resource discovery for this server and continue; any other error propagates.","preventionTips":["Record each server's advertised capabilities at connect time and gate resource code on them","Use resource-capable servers (e.g. filesystem) when resource features are required","Alert on capability changes after server upgrades so gates stay accurate"],"tags":["mcp","capability","resources","feature-gate"],"backgroundTag":"capability-unsupported","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}