A tool call fails with an error.
What should your loop do?
- ARetry the same call a few more times with the same arguments, since most tool errors are temporary
- BFeed a clear error message back so the model can adapt
- CSilently ignore it and continue
- DRetry the exact call forever
Answer: B
Feed a clear error message back so the model can adapt
Why
Turn errors into information: a clear error message back in the loop lets the model correct course. Crashing, ignoring, or blind retries all fail.
- Errors & recoveryA streamed generation fails mid-way.
- Errors & recoveryA tool call returns HTTP 400 “invalid parameter: date must be ISO-8601”.
- Errors & recoveryYour fleet of agents all hit a 429 rate-limit at once and every one immediately retries on a fixed 1-second timer.
- Errors & recoveryAn agent processes a batch of 100 records.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path