How should an agent degrade gracefully when a third-party API tool with 99% uptime is unavailable?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Retry with exponential backoff, circuit breaker on repeated failures, and a structured tool-error message to the LLM so it can choose an alternate path instead of silently retrying forever.
Imagine you are working with a friend who sometimes does not answer the phone. The first time the line is busy, you try again in a few seconds. The second time, you wait a bit longer. If they have not answered after a few tries, you stop calling for a while so you do not flood their phone, and you decide whether to try someone else, do the task yourself with what you know, or ask for help. You do not pretend they answered when they did not, because then you would tell people the wrong thing. And you do not give up your whole day just because one friend is not picking up. An agent's tool-failure handling works the same way.
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.
Open with the framing that tool failure is a state the agent has to reason about, not an exception. Walk the three layers: retry with exponential backoff for transient blips, circuit breaker with open/half-open/closed states for sustained outages, structured tool-error message that the LLM can read and route around. Emphasise that the error must be honest. Cover idempotency keys on retries of mutating tools, observability on retries and breaker events, and the discipline of teaching the model how to respond to tool errors via the prompt or fine-tuning.
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.
Silent retry forever or returning fake empty results. Both hide the failure from the agent and the user, producing stalled tasks or confidently wrong answers.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.