Aiyana Greyhorse 7 min readA language model can explain how to schedule a meeting, but explanation alone does not place an event on a calendar. To affect the world, the model needs a controlled bridge into ordinary software. That bridge is tool calling: a mechanism through which a model selects an available operation and proposes structured arguments for it.
This may look like a minor technical feature. It is better understood as a new division of labor. The model interprets intent and chooses a possible action; deterministic software verifies, authorizes, and executes it. Once that distinction is clear, the design space becomes far easier to navigate.
The Essential Vocabulary
A tool is a bounded operation exposed to a model. It might search a product catalog, retrieve an account balance, calculate shipping, create a support ticket, or draft a calendar event. Each tool normally has a name, a description, and an input schema.
A tool call is not the action itself. It is structured output expressing the model’s request to invoke a tool. For example, instead of writing “I will check the weather in Kyoto,” the model might produce arguments equivalent to a city of Kyoto and a date of tomorrow for a weather lookup.
The surrounding application is the orchestrator. It sends the user’s request and tool definitions to the model, receives a proposed call, validates the arguments, runs the corresponding function, and returns the result to the model. The model can then formulate an answer or request another tool.
An agent is a broader system concept. It may use tools repeatedly, maintain state, pursue a goal, and respond to outcomes. Tool calling is one mechanism inside an agent, not a synonym for the entire agent.
The Mental Model: Proposal, Enforcement, Execution
The safest mental model has three layers.
| Layer | Responsibility | What must not be assumed |
|---|---|---|
| Model | Interpret language, select a tool, propose arguments | That its proposal is valid, permitted, or factually correct |
| Orchestrator | Validate, authorize, route, record, and manage failures | That every syntactically valid call should run |
| Tool | Perform a narrow deterministic operation | That the caller has already handled every business rule |
The model is a planner with imperfect judgment. The orchestrator is the policy boundary. The tool is an adapter to a real capability. Keeping these roles distinct prevents a common architectural mistake: allowing persuasive language to bypass operational controls.
Tool definitions also shape model behavior. A vague tool called manage_account forces the model to infer too much. Narrow tools such as get_account_status, prepare_address_change, and submit_address_change expose clearer choices and permit different authorization rules.
What Happens During a Tool-Calling Loop
- The application receives a user request.
- It sends relevant conversation context and a selected set of tool definitions to the model.
- The model either answers directly or proposes a tool call with structured arguments.
- The orchestrator validates types, required fields, permissions, and business constraints.
- The application executes the tool if the call is allowed.
- The tool returns a structured result or a defined error.
- The application sends that result back to the model.
- The model explains the outcome, asks for missing information, or proposes another call.
Consider a customer who says, “Move my Friday delivery to Monday.” The model may first call a tool that lists upcoming deliveries because “Friday” needs grounding in an actual order and date. After receiving the delivery record, it can propose a rescheduling call.
The orchestrator should still check whether the order belongs to the authenticated customer, whether Monday is available, and whether the change window remains open. If rescheduling has an irreversible consequence or fee, the system can present a preview and require confirmation before submission.
This is the central mechanism: the model resolves linguistic ambiguity, while conventional code protects operational truth.
Designing Tools the Model Can Use Reliably
Good tool design resembles good API design, but descriptions matter more because the immediate consumer interprets natural language.
Use narrow, explicit operations
A tool should have one legible purpose. Separate reading from writing where possible. A lookup can often run automatically; a mutation may require confirmation, stronger authentication, or an approval step.
Make arguments difficult to misunderstand
Prefer constrained fields over free-form text. A shipping speed represented by a small set of accepted values is safer than a general “instructions” string. Use stable identifiers after retrieval rather than asking the model to invent or reconstruct them.
Describe boundaries, not merely capabilities
A useful description explains when the tool should be used, when it should not be used, and what prerequisites exist. If cancellation is unavailable after dispatch, encode that rule in validation and mention it in the description. Prose guides selection; code enforces policy.
Return structured outcomes
A tool result should distinguish success, recoverable failure, and permanent rejection. “Failed” gives the model little guidance. “Address requires a postal code” supports a follow-up question. “Order has already shipped and cannot be cancelled” supports a truthful final response.
The Risks Begin Where Language Meets Authority
Tool calling introduces risks that ordinary chat does not. The most important is excessive authority. A model able to read records, modify them, send messages, and initiate payments has a broad failure surface even if each individual tool appears reasonable.
- Hallucinated arguments: The model may supply an identifier or date the user never provided. Resolve identifiers through trusted lookup steps and reject unsupported values.
- Prompt injection: Content retrieved from a webpage, document, or message may contain instructions designed to redirect the model. Treat external content as data, not authority.
- Duplicate execution: Retries can repeat a purchase, ticket, or message. Use idempotency keys so the same intended operation is applied once.
- Permission confusion: The user’s request does not prove authorization. Check identity and scope outside the model.
- Silent partial failure: One step in a multi-tool sequence may succeed while another fails. Record each transition and explain the actual state.
Confirmation screens are useful, but they are not universal protection. A user may approve a misleading summary. For consequential actions, generate the preview from validated structured arguments rather than trusting the model to describe its own proposed call.
A Sensible First Project
Begin with one read-only tool and one low-consequence write tool in a domain you can inspect. A support assistant is a practical example: it can search approved help content and prepare a ticket draft, while a person decides whether to submit it.
- Choose one bounded user intent. Avoid “handle support.” Start with “find relevant guidance and draft an escalation.”
- Define schemas. The search tool might accept a query and product area. The draft tool might accept a summary, category, and evidence references.
- Keep submission separate. Drafting and sending should be different operations with different permissions.
- Create adversarial examples. Test missing details, contradictory requests, malicious text inside retrieved content, invalid identifiers, timeouts, and repeated submissions.
- Log the full decision trail. Record the user request, tools offered, call arguments, validation outcome, tool response, and final answer. Redact sensitive fields where necessary.
- Measure behavior by task. Examine correct tool selection, valid arguments, unnecessary calls, permission violations, recovery from errors, and final outcome—not merely whether the response sounds polished.
A revealing test is to remove a required fact from the request. A dependable system should ask for it or retrieve it through an authorized tool. If it fabricates the value, better wording alone will not solve the problem; the workflow needs stronger validation.
Trade-Offs Worth Seeing Early
Offering more tools increases capability but also makes selection harder. A large catalog can contain overlapping descriptions, expose unnecessary authority, and increase the chance of an irrelevant call. Select tools dynamically according to the user, workflow stage, and permission scope.
Long autonomous loops can complete richer tasks, yet every additional step compounds uncertainty and creates another failure point. A short sequence with explicit checkpoints is often more useful than an open-ended agent. Autonomy should expand only after observed evidence shows that the preceding level is dependable.
There is also tension between flexible arguments and rigid schemas. Flexibility accommodates natural requests but transfers ambiguity into execution. Rigidity improves safety but may force more clarification. The right boundary is usually asymmetric: flexible interpretation before the call, strict data at the execution boundary.
What to Ignore for Now
Do not begin with multi-agent coordination, self-modifying plans, dozens of integrations, or elaborate memory systems. These can become relevant, but they obscure the foundational question: can one model choose one appropriate tool, provide grounded arguments, and recover when the operation fails?
Do not optimize first for the smallest number of model calls. An extra lookup or confirmation can be valuable if it replaces an assumption with verified state. Nor should you judge the system from a successful demonstration. Demonstrations follow the intended path; products encounter stale data, ambiguous language, permission changes, retries, and hostile inputs.
The durable opportunity is not to give a model unrestricted access to software. It is to design a precise constitutional boundary between interpretation and execution. The model may propose. The application must decide what the proposal is allowed to become.
This post was drafted with AI assistance and reviewed against our editorial policy before publication. Corrections are made at the source, on the page, with the date shown.
Rate this article
Discussion
Comments are moderated. Read our editorial policy.