Tool Calling
Tool calling lets a model request external actions such as search, database lookup, calculation, or API calls.
Use tool calling when the model needs capabilities outside text generation, but keep the application in charge of execution.
Use when
- Search and retrieval
- API lookups
- Calculations
- Controlled product actions
Avoid when
- Untrusted destructive actions
- Ambiguous permissions
- Tasks where plain generation is enough
- Unvalidated tool arguments
What tool calling adds
Tool calling connects a model to the outside world. The model can decide that it needs a search result, a database row, a calculation, or a product action.
The application should validate arguments, enforce permissions, execute the tool, and pass results back to the model.
Tool calling is not automatically an agent
A single tool call inside a controlled flow is not necessarily an agent. Agents use tool calling as part of a broader loop where the model chooses multiple steps.
Common mistakes
- Letting the model execute tools without validation.
- Giving tools broad permissions.
- Confusing tool schemas with business rules.
Next decision
Start with narrow tools and explicit permissions. Add agent-like loops only when the task requires adaptive tool use.