Tool calling
What is Tool calling?
Tool calling is the mechanism that lets a language model invoke an external function or API — looking up an order, sending an SMS, checking a calendar — as part of generating its response, instead of being limited to producing text alone. The model is given a schema describing each available tool's name, purpose, and expected parameters, decides when a tool is needed, and the surrounding application executes the actual call and returns the result back to the model.
More detail
Tool schemas typically describe each parameter's type and purpose in plain language, since the quality of that description directly affects how reliably the model chooses the right tool and fills in correct arguments.
The model itself never executes a tool call directly — it emits a structured request that the surrounding application validates and runs, which is also where guardrails can block an unsafe or out-of-scope call.
Frequently asked
- Does the language model directly execute a tool call itself?
- No — the model only emits a structured request naming the tool and its arguments; the surrounding application is responsible for actually executing that call, validating it, and returning the result back to the model.
- What happens if a model calls a tool with invalid arguments?
- A well-built integration validates the arguments before execution and returns an error back to the model, which can then retry with corrected arguments or ask the user for clarification, rather than the call silently failing.
See also
Build it on Orbit
Voice, messaging, email, video, and AI agents on one platform and one pay-as-you-go bill. Start free — no credit card required.