Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Tool error: successful response with `isError: true` plus content the model reads. Protocol error: JSON-RPC error object with numeric code; the host catches it and the model never sees it.
Imagine ordering food at a restaurant. Two ways things can go wrong. First: the kitchen tried to cook your dish but ran out of an ingredient. The waiter brings you a polite note explaining and asks if you want something else. That is a tool error. The tool ran, but the result was a failure. You (the model) read the note and decide what to do next. Second: the waiter does not understand what you said because you spoke a language they do not know. The conversation broke down before anyone could try cooking. That is a protocol error. The system failed before the operation even started. MCP uses different channels for each: a flag inside a normal response for the first kind, a numbered error code for the second.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: walk both error channels with one example each, state the decision test (can the model act on it?), name the standard JSON-RPC codes, describe the most common bug (mixing channels), and close with the host-side convention of reformulating -32602 as an isError tool result for model recovery.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Returning a JSON-RPC error for tool business-logic failures. The model never sees JSON-RPC errors. Use `isError: true` in the result so the model can read the failure and decide how to recover.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.