{"record":{"id":"6859fc0546222c9e","repo":"Kuberwastaken/claurst","slug":"rmcp-list-prompts-failed","errorCode":null,"errorMessage":"rmcp list_prompts failed: {}","messagePattern":"rmcp list_prompts failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/mcp/src/rmcp_backend.rs","lineNumber":557,"sourceCode":"        let result = self\n            .peer\n            .read_resource(rmcp_model::ReadResourceRequestParams::new(uri.to_string()))\n            .await\n            .map_err(|e| anyhow::anyhow!(\"rmcp read_resource '{}' failed: {}\", uri, e))?;\n        let first = result\n            .contents\n            .into_iter()\n            .next()\n            .ok_or_else(|| anyhow::anyhow!(\"rmcp read_resource '{}' returned no contents\", uri))?;\n        Ok(convert_resource_contents(first))\n    }\n\n    async fn list_prompts(&self) -> anyhow::Result<Vec<McpPrompt>> {\n        let prompts = self\n            .peer\n            .list_all_prompts()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"rmcp list_prompts failed: {}\", e))?;\n        Ok(prompts.into_iter().map(convert_prompt).collect())\n    }\n\n    async fn get_prompt(\n        &self,\n        name: &str,\n        arguments: Option<HashMap<String, String>>,\n    ) -> anyhow::Result<GetPromptResult> {\n        let mut params = rmcp_model::GetPromptRequestParams::new(name.to_string());\n        if let Some(arguments) = arguments {\n            let args = arguments\n                .into_iter()\n                .map(|(key, value)| (key, Value::String(value)))\n                .collect();\n            params = params.with_arguments(args);\n        }\n        let result = self\n            .peer","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/mcp/src/rmcp_backend.rs#L539-L575","documentation":"Raised in `RmcpClientBackend::list_prompts` when the rmcp peer's `list_all_prompts()` future fails during the `prompts/list` round-trip. Any transport failure or JSON-RPC error response from the MCP server is re-wrapped under a uniform message identifying the backend operation. This mirrors the list_tools/list_resources wrappers and keeps the original rmcp error in the message.","triggerScenarios":"Calling `list_prompts` when the server rejects `prompts/list`: server lacks the prompts capability ('method not found'), session closed or stale, transport error, or the server errored while enumerating its prompt definitions.","commonSituations":"Most tool-only MCP servers do not implement prompts, so this fires on nearly every tool-only server; server restarted between connect and the listing; prompt definitions loaded from files that failed to parse server-side; user runs a slash-command discovery pass against a server without prompt support.","solutions":["Check the inner error: 'method not found' means no prompts capability — treat as an empty prompt list.","Reconnect the MCP session and retry if the transport closed.","Verify the server advertises the prompts capability during initialization.","Inspect server logs if the enumeration itself failed."],"exampleFix":"// before: failing hard on prompt listing\nlet prompts = backend.list_prompts().await?;\n// after: degrade gracefully for tool-only servers\nlet prompts = match backend.list_prompts().await {\n    Ok(p) => p,\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_prompts(init_caps: &ServerCapabilities) -> bool {\n    init_caps.prompts.is_some()\n}","typeGuard":null,"tryCatchPattern":"match backend.list_prompts().await {\n    Ok(prompts) => prompts,\n    Err(e) if e.to_string().contains(\"method not found\") => Vec::new(),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Check the prompts capability in the initialize response before listing prompts.","Expect tool-only MCP servers to reject prompts/list and design the UI to show an empty command list.","Recreate the backend after server restarts instead of reusing the old peer.","Cache prompt listings with a TTL to reduce round-trips that can hit stale sessions."],"tags":["mcp","jsonrpc","prompts","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"}