KNOWLEDGE / Agents / Tool Calling
How Agent Tool Calling Works
A practical mental model for tool selection, execution, validation, and recovery in agentic systems.
AgentsTool Calling
- DOMAIN
- AI Engineering
- LEVEL
- Intermediate
- READ
- 7 min
- UPDATED
- Aug 28, 2026
MENTAL MODEL / KEY IDEAS
Keep these in mind
- 01Treat a tool call as an untrusted request
- 02Keep execution outside the model
- 03Make recovery state explicit
The basic loop
A model proposes a tool and arguments; the application validates, authorizes, executes, and returns a structured result. The model never directly runs application code.
- Select
- Validate
- Execute
- Observe
- Continue or stop
Where reliability comes from
Reliability lives in the orchestration layer: typed arguments, timeouts, idempotency, permission boundaries, and a bounded retry policy.
- Reject unknown tools
- Record every transition
- Separate retryable from terminal failures
A useful design rule
Let the model decide what may be useful, but let deterministic code decide what is allowed and whether the result is valid.