New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
One expected tool failure, and the whole session dies right there.
What you'll have at the end
A tool handler that returns isError with a plain message on every expected failure, confirmed the model reads it and retries
You need
A working MCP tool whose handler already evaluates its input or business state and can detect at least one expected failure, an invalid value, a rule that says no, but currently reports it as a raised fault or a message with no specifics.
Not covered
Retry limits and human escalation for a model that keeps calling a still-failing tool; this covers writing the one message that lets a single expected failure resolve itself.
Leans on
Catch a broken MCP tool with Inspector
diagnose whether a tool result's error text came from a schema rejection or your own handler before you rewrite what it says.
Resubmit a rejected reply with the schema error attached
the same specific-message-drives-a-correct-retry idea, for a structured-output call instead of an MCP tool result.
Checked 15 Aug 2026
Part of the MCP Servers Implementation cookbook