Kuberwastaken/claurst · error
rmcp list_prompts failed
Error message
rmcp list_prompts failed: {} What it means
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.
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.
Example fix
// before: failing hard on prompt listing
let prompts = backend.list_prompts().await?;
// after: degrade gracefully for tool-only servers
let prompts = match backend.list_prompts().await {
Ok(p) => p,
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_prompts(init_caps: &ServerCapabilities) -> bool {
init_caps.prompts.is_some()
} Try / catch
match backend.list_prompts().await {
Ok(prompts) => prompts,
Err(e) if e.to_string().contains("method not found") => Vec::new(),
Err(e) => return Err(e.into()),
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
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 list_resources failed
- rmcp get_prompt ' ' failed
- rmcp call_tool ' ' failed
- rmcp read_resource ' ' failed
AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10).
Data as JSON: /api/errors/6859fc0546222c9e.
Report an issue: GitHub.
Appendix: source
Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:557
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>> {
let prompts = self
.peer
.list_all_prompts()
.await
.map_err(|e| anyhow::anyhow!("rmcp list_prompts failed: {}", e))?;
Ok(prompts.into_iter().map(convert_prompt).collect())
}
async fn get_prompt(
&self,
name: &str,
arguments: Option<HashMap<String, String>>,
) -> anyhow::Result<GetPromptResult> {
let mut params = rmcp_model::GetPromptRequestParams::new(name.to_string());
if let Some(arguments) = arguments {
let args = arguments
.into_iter()
.map(|(key, value)| (key, Value::String(value)))
.collect();
params = params.with_arguments(args);
}
let result = self
.peerView on GitHub (pinned to b0637c97ec)