All glossary terms
T Architecture Security

Tool calling

The model never calls anything. It produces text shaped like a request, and your code decides whether to run it. Every tool call in production is a decision your software made, which is where the accountability actually sits.

Definition

Tool calling is how a language model uses software. The model does not run anything itself. It produces a structured request that names a tool and the inputs to use, and your code decides whether to run it. This means every tool call that happens is a decision your code made.

What is tool calling?

The mechanism that turns a text generator into something capable of acting. It is arguably the single most consequential primitive in any agentic system and certainly the most widely misunderstood, largely because the name describes an action the model itself never performs.

The misunderstanding is worth correcting precisely, because every governance question on this page follows from it.

What people assume tool calling is, and what it actually is
The assumption What actually happens
The model calls an API The model produces text in a defined shape, naming a tool and some arguments. It has no network access and executes nothing
The model decided to do that The model proposed it. Your code received the proposal and chose to execute it, which is a different act with a different owner

That second row is the whole argument. A model cannot do anything to your systems; software you wrote does things on the strength of what a model suggested. Which means the question is never whether to trust the model, but what your executor is prepared to run on its say-so.

What happens in a tool call?

A tool call has six steps, and only one of them belongs to the model. Going through them in order shows where each control needs to go. A common mistake is placing a control too late, at a stage where the decision has already been made and the only thing left to do is act on it.

The sequence, with the point of intervention marked.

Six steps in a tool call. First, your code sends the model a list of available tools with their descriptions and parameter schemas. Second, the model produces text naming a tool and arguments, which is a proposal rather than an execution. Third, your code parses that proposal. Fourth, your code validates it against the schema and your policy, which is marked as the control point. Fifth, your code executes the tool if it passed. Sixth, the result is returned to the model, which reasons again. A note marks step four as the only place a control can actually hold, since steps one to three have changed nothing in the world.
  1. 01
    You supply the tool listNames, natural-language descriptions and parameter schemas go into the model's context. What this decides: the entire set of things that can possibly be proposed. Scoping happens here, not later.
  2. 02
    The model proposesIt emits a tool name and arguments in a defined format. Note: this is the only step the model performs, and nothing has happened in the world yet.
  3. 03
    Your code parses and validatesShape, types, ranges, permissions, and whether this caller may do this now. What this decides: everything. This is the only point where a control can hold.
  4. 04
    Your code executes, and returns the resultThe output goes back into context and the model reasons again with it. What this decides: what the model now believes, which is why tool output is an injection surface. See prompt injection.

Reading the sequence this way settles a common design argument. Instructing the model not to do something is a preference expressed at step one; refusing to execute it is a control applied at step three, and only the second survives a model that behaves unexpectedly or a prompt somebody manipulated.

Why does the tool description matter more than the model?

The model chooses a tool based on its description. It compares the plain-language sentence you wrote with the task it is working on. This means that vague or overlapping descriptions cause far more wrong choices in practice than any weakness in the model’s reasoning.

Which makes tool descriptions an unusual artefact: documentation that is also executable instruction.

  • Ambiguity between two tools is the top cause of wrong selection. If two descriptions could plausibly cover the same request, selection becomes close to arbitrary, and no model upgrade fixes a distinction you never drew.
  • Parameter names carry meaning. A field called id invites the model to supply something that looks like an identifier. A field called customer_account_number invites the right one. Naming is prompt engineering with a schema attached.
  • Describe when not to use it. The most valuable sentence in most tool descriptions is the exclusion, because models over-apply tools that sound generally useful.
  • The description is read by the model, so it is an attack surface. Instruction-shaped text in a tool description is instruction, which is the tool poisoning problem covered at the Model Context Protocol.

A practical consequence worth acting on before anything else. When an agent picks the wrong tool, rewrite the description before you change the model, since it is a five-minute change with a larger effect, and the alternative is paying more per call to compensate for a sentence nobody edited.

Where does the trust boundary sit?

Inside your executor, and nowhere else. Everything preceding execution is just text: text you supplied, text the model returned. The boundary is the instant your own code resolves to act on that text, which makes it the single place where a security control is enforced rather than politely requested.

Four consequences that follow directly.

  • Validate as though the arguments came from the internet. They effectively did, since anything in context can influence them. Schema validation, range checks and authorisation belong in the executor, not in the instructions.
  • The agent's permissions are the real blast radius. A tool executes with whatever credentials your code holds, so scoping credentials per agent is the control that bounds the worst case. See agent identity.
  • Tool output re-enters the prompt. Whatever a tool returns becomes context the model reasons over, so an untrusted tool is an untrusted input channel rather than merely an unreliable one.
  • Irreversible tools need a gate, not a warning. A description saying to be careful is read by something with no concept of consequence. Approval has to be enforced in the executor.

The framing that makes this tractable for a security review. Tool calling is not a new category of risk; it is remote code execution with a probabilistic caller. Everything your organisation already knows about validating untrusted input applies without modification, and the only novelty is that the caller is persuasive rather than malicious. Teams that start from that position get further than teams treating it as an unprecedented AI problem.

What goes wrong?

There are five causes, and only one of them involves the model being factually wrong. The other four are design problems that look like model problems. That is why switching to a more capable model so rarely fixes any of them.

In rough order of how often they appear in production.

  • Wrong tool chosen. Two descriptions overlapped. A description problem.
  • Right tool, wrong arguments. The model inferred a value the context did not contain. Usually a schema that permitted something it should have rejected.
  • Tool not called at all. The model answered from memory instead of checking. This is the most dangerous failure because the output looks normal, and it is why grounding matters more than fluency.
  • Called repeatedly. No stopping condition, so the agent retries variations of the same call. The largest avoidable cost line in most token bills.
  • Succeeded, wrong outcome. The call returned a valid result that did not answer the question, and nothing errored. This is the 200 OK problem described at AI agent observability.

The third one deserves separating out because it inverts the usual diagnosis. An agent that did not call a tool produces the most convincing wrong answers, since there is no failed call in the trace to investigate and the response reads exactly like a successful one.

How do you design tools for agents?

Differently from how you design an API for developers. A developer reads documentation once, learns the system and remembers it. A model re-reads the description on every call and has no memory of having used the tool before, which changes what a good interface looks like.

Five rules, in order of effect.

  1. Fewer tools, more sharply distinguished

    Twelve well-separated tools beat forty overlapping ones. Every additional tool adds a chance of wrong selection and consumes context on every single call.

  2. Write the description for selection, not for completeness

    One sentence on what it does, one on when to use it, one on when not to. Exhaustive documentation makes the model worse at choosing, which is the opposite of the instinct.

  3. Make the schema strict enough to reject nonsense

    Enumerations rather than free strings wherever the set is known. A schema that accepts anything turns a validation problem into a production incident.

  4. Return errors the model can act on

    A message saying which argument was invalid and what was expected lets the agent correct itself. A generic failure produces a retry loop, which is where the cost goes.

  5. Register tools centrally rather than per agent

    One definition, one scope, one place to revoke. Tools defined inside individual agents cannot be inventoried, which is how an estate loses track of what its agents can reach.

One design principle that is easy to state and routinely ignored. Design the tool around the decision the agent has to make, not around the system behind it. Exposing an existing API surface verbatim gives the model six calls to assemble an answer where one well-shaped tool would have returned it, and each of those six is an opportunity to go wrong.

Frequently asked questions about tool calling

If your question is not here, our team will answer it directly.


Talk to a Specialist →
What is tool calling?

The mechanism that turns a text generator into something that can act. It is the most consequential primitive in agentic systems and the most widely misunderstood, because the name describes something the model does not do. The model produces text in a defined shape naming a tool and arguments; it has no network access and executes nothing.

Does the model actually call the tool?

No. The model proposes. Your code receives the proposal and chooses to execute it, which is a different act with a different owner. A model cannot do anything to your systems; software you wrote does things on the strength of what a model suggested. So the question is never whether to trust the model, but what your executor will run on its say-so.

What are the steps in a tool call?

Your code sends the model a list of tools with descriptions and parameter schemas. The model emits a tool name and arguments. Your code parses that, validates it against schema and policy, executes if it passes, and returns the result into context so the model can reason again. Only the second step is performed by the model.

Where should controls be enforced?

At validation, before execution. Instructing the model not to do something is a preference expressed in the prompt; refusing to execute it is a control applied in your code. Only the second survives a model behaving unexpectedly or a prompt somebody manipulated, which is why guardrails written as instructions fail in exactly the situations they were written for.

Why does the tool description matter so much?

Because the description is how the model chooses. Tool selection is driven by a natural-language sentence you wrote, matched against the task, so an ambiguous description produces wrong selection far more often than model capability does. If two descriptions could plausibly cover the same request, selection becomes close to arbitrary and no model upgrade fixes a distinction you never drew.

What makes a good tool description?

One sentence on what it does, one on when to use it, and one on when not to. The exclusion is usually the most valuable, because models over-apply tools that sound generally useful. Parameter names carry meaning too: a field called id invites something that looks like an identifier, while a specific name invites the right value.

Should you change the model or the description first?

The description, almost always. When an agent picks the wrong tool it is usually a five-minute edit with a larger effect than a model change, and the alternative is paying more per call to compensate for a sentence nobody edited. Model upgrades rarely fix selection problems because the ambiguity is in your text rather than in the model's reasoning.

Where does the trust boundary sit in tool calling?

Inside your executor and nowhere else. Everything before execution is text: text you sent and text the model returned. The boundary is the moment your code decides to act on that text. Validate arguments as though they came from the internet, because anything in context can influence them, and put authorisation in the executor rather than in the instructions.

Is tool calling a new category of security risk?

Not really, and that framing helps a security review. It is remote code execution with a probabilistic caller. Everything your organisation already knows about validating untrusted input applies without modification, and the only novelty is that the caller is persuasive rather than malicious. Teams starting from that position get further than teams treating it as unprecedented.

What is the most dangerous tool calling failure?

The tool not being called at all. The model answers from memory instead of checking, which produces the most convincing wrong answers because there is no failed call in the trace to investigate and the response reads exactly like a successful one. Every other failure leaves evidence; this one leaves a fluent answer and nothing else.

Why do agents call the same tool repeatedly?

Usually no stopping condition, compounded by unhelpful error messages. An agent that receives a generic failure has nothing to correct, so it retries variations of the same call, and that loop is the largest avoidable cost line in most token bills. Returning an error naming the invalid argument and what was expected lets the agent fix itself instead.

How should you design tools for an agent?

Differently from an API for developers, who read documentation once and remember it. A model re-reads the description every call with no memory of previous use. Prefer fewer, sharply distinguished tools; write descriptions for selection rather than completeness; use strict schemas with enumerations; and design around the decision the agent must make rather than exposing the system behind it verbatim.

One definition, one scope, one place to revoke
Can you list every tool your agents are able to call?

The Agent Work Bench in SERAA Cortex registers tools centrally through its MCP Hub with scope and execution logic held in one place rather than inside individual agents, and its Agent Control Tower records every model and tool call with the agent, the model, the user and the cost.