# mcp.tools.error.ToolError

- **Module:** mcp.tools.error
- **Package:** tmux-mcp
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/tmux-mcp/src/tools/error.rs#L18
- **Page:** https://libtmux.org/en/rs/latest/mcp/reference/mcp-tools-error-toolerror/

This type appears in public signatures. It is not a package entry point.

A tool-execution failure, reported as `isError` tool 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 `error`
field; the second is data the model reads and acts on, which is what
[`rmcp::model::CallToolResult::is_error`] is for. Every helper below
builds one of these instead of a raw [`ErrorData`], 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 needs [`Self::into_error_data`] to read it.

## Members

- `into_error_data` (method): Recover the underlying [`ErrorData`].
