mcp.tools.error.ToolError
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
This type appears in public signatures. It is not a package entry point.
-
A tool-execution failure, reported as
isErrortool content.MCP separates protocol faults (unknown tool, arguments that do not match the schema -- rejected before a tool body ever runs) from failures a tool body discovers itself. Only the first belongs in the JSON-RPC
errorfield; the second is data the model reads and acts on, which is whatrmcp::model::CallToolResult::is_erroris for. Every helper below builds one of these instead of a rawErrorData, so a tool signature that returns `Result<_, ToolError>` cannot surface a tmux or input refusal as a protocol error by construction.Public, and re-exported at the crate root: a caller that invokes
crate::TmuxTools's methods directly, rather than over the wire, gets this type back and needsSelf::into_error_datato read it.
Members
-
Recover the underlying
ErrorData.For the one caller that reports a nested tool's own failure inside a batch item rather than as this tool's failure (
crate::TmuxTools::call_read_tools_batch), and for a test that calls a tool directly and inspects the classification a wire client would otherwise read fromisErrorcontent.