Automation & agents · Analysis
What should an agent’s tool error say?
Design machine-readable tool failures that let the product distinguish an invalid request, timeout and an unknown result.

A support assistant shows users the same recovery message for a missing order ID and a provider timeout. The first needs clarification. The second may require checking an earlier request before retrying.
Return the type of failure
A tool response should expose a small, stable error class, a correlation reference and whether the operation was observed to finish. Anthropic’s tool design guidance highlights useful error responses for agents.
Source · Anthropic · Writing effective tools
Keep recovery close to the service
A tool call passes through the application before its result goes back to the model. Translate private provider details into safe messages there. Keep permission failures distinct from retryable read failures.
Source · OpenAI · Function calling
Replay one fault per transition
Use a sample lookup with no identifier, a service outage, and a write whose status is unknown. The assistant should ask for an ID, show a retry path, or pause for review, respectively.
What to take away
An error result should equip the next decision and preserve a support reference. Its length matters less than a reliable recovery signal.