Tool Error Handling

Domain: Tools & Function Calling

🎯 Motivation

When a tool call fails (API down, invalid parameters, timeout), the agent must handle the error gracefully.

πŸ“‹ Concrete Example

Tool call: get_weather(Mars) -> Error: β€˜City not found.’ Agent handles: β€˜I could not find weather for Mars. Did you mean a city on Earth?’ It does not crash; it adapts.

πŸ”— Analogy

A delivery driver getting a flat tire - they do not abandon the delivery. They call for help, find alternative transport, or notify the customer. Tool error handling is the agent adapting when tools fail.