A tool call to a slow API sometimes fails. How do you make the tool reliable?
Why C is the answer
Timeouts, retries and clear error handling
Timeouts, retries and clear error handling stop a slow API from hanging the tool or the agent.
In detail
- Timeouts, retries and clear errors make a tool reliable.
- Give the agent an error message it can use.
Use case
An illustrative scenario, not a real incident.
A tool waits forever on a slow API. A timeout and limited retries return a clear error, so the agent can adapt.
See it in different ways
sequenceDiagram participant A as Agent participant T as Tool participant D as Durable storage A->>A: Reason A->>T: Act, with a timeout T-->>A: Result or clear error A->>D: Save state A->>A: Observe, then decide
flowchart TD
Q{"What happened?"}
Q -->|"Timed out, temporary"| A0["Retry with a limit"]
Q -->|"Keeps failing"| A1["Return a clear error"]Key point: Tools need timeouts and retries.
Why the other options are wrong
- A. A longer tool name, so that the model is more likely to choose it
- A name does not help.
- B. A second copy of the same tool, with an identical description
- A duplicate confuses tool choice.
- D. A model with a higher temperature for the tool selection step
- Temperature does not help a slow API.

