pub fn tool_error(text: impl Into<String>) -> ValueAvailable 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.