Blog

Tool calling, from first principles

A model cannot call anything. It writes a structured request and something else executes it. How the exchange works, and where Agent200 sits in it.

2 min read

A row of hanging spheres, one green sphere lifted mid-swing

Tool calling is what turns a language model into an agent. Without it, a model can only talk about the world. With it, the model can look things up and take actions. The mechanism is simpler than it sounds, and understanding it makes you better at building on top of it.

A model cannot call anything

A model produces text. It has no network access and runs no code. “Calling a tool” means the model produces a structured request, and some other system executes it.

The exchange, step by step

  1. You describe the tools. Each has a name, a description and an input schema.
  2. The model reads the task and the tools. It decides whether answering requires one.
  3. The model emits a tool call: the tool’s name and arguments, as structured data.
  4. The executor runs it. It calls the real API with real credentials and gets a result.
  5. The result goes back to the model as new context.
  6. The model continues: it calls another tool, or writes the final answer.

What a tool call looks like

Illustrative shape:

{
  "tool": "customer_context",
  "arguments": { "customer": "acme.com" }
}

Nothing in it says how to reach a CRM or which credentials to use. That is the executor’s job.

Everything the executor has to do

  • validate the arguments,
  • find the right user’s credentials, and refresh them if they expired,
  • call the provider’s API correctly,
  • shape the response so it does not flood the model’s context,
  • handle the case where the user never connected the account,
  • repeat for every call, until the model is done.

This is the part most teams end up building by hand, and rebuilding for every new service.

Where Agent200 sits

Inside a run() request, Agent200 is the executor. It gives the model the definitions of the tools you allowed, runs each call through the right connector or workflow for the user you named, returns the result to the model and keeps the loop going until the answer is ready. You send one request and receive one result.

Three things worth remembering

  • Available is not called. Listing a tool gives the model the option; it decides during execution whether to use it.
  • Descriptions are the interface. The model chooses from the name and description, so write them carefully.
  • Results are context. Every result takes space in the window; compact results leave room for reasoning.

Go deeper with Inside run() and writing tool descriptions.

Stacks of envelopes being organised into an index card cabinet with green tabs
Product

iGPT: your agent’s email context in one request

iGPT is a premium connector on Agent200. It indexes your users' email, threads and attachments, and answers your agent with cited, structured context in…

1 min read

Five frosted glass lenses of different shapes in a row, one with a green edge
Guides

Choosing a web search API for your agent

Tavily, Exa, Brave Search, Perplexity and Firecrawl each lean toward a different part of search. How to pick for your agent, and why you…

2 min read

200 OK

Build the agent.
Access everything it needs.

Bring the agent you already have. Agent200 provides and executes its external capabilities.

Book a demo.
See it in action.

Tell us who you are, then pick a time for a 1:1 session with an expert from our team.

We use your details only to email you about Agent200. See the Privacy Policy.

Pick a time. We'll take it from there.

A 1:1 session with an expert from our team, about what you are building.

Open in Calendly (opens in a new tab)