Skip to main content

tool_error

Function tool_error 

Source
pub fn tool_error(text: impl Into<String>) -> Value
Available on crate feature mcp only.
Expand description

Wrap a tool error in the MCP tools/call content shape (isError: true).

Per the MCP spec a tool failure is reported as a normal result with isError: true (not a JSON-RPC protocol error), so the model can see and react to it.