Skip to Content

6. Tool Calling

Let the model pick and invoke tools. Build at least three: a calculator, a live HTTP call (e.g. Open-Meteo, no key needed), and a text formatter. The model must route correctly and handle a tool error gracefully.

Watch For

Reliability Patterns

Apply these immediately:

PatternPurpose
Retries with backoff + jitterTransient errors (timeouts, 429s, some 5xx)
Fallback chainsCheaper → stronger, or Provider A → Provider B
Circuit breakersPrevent a failing provider from cascading into an incident

Resources

OpenAI function calling · Claude tool use