- Intercept the failed tool response.
- Analyze the error (e.g., checking for a 429 or 500 status code).
- Trigger a retry autonomously, ensuring a seamless user experience.
Handling Tool Errors
Post-Hook Retry
Automatically retry a tool call using a post-hook with RetryAgentRun.
In agentic workflows, tools can fail due to rate limits, network glitches, or temporary API downtime. Instead of the agent giving up or asking the user for help, a post-hook allows the system to:
For details, see Post hook tool retries cookbook.