Skip to content

AI, decoded

How does an AI agent decide which tool to use?

The agent is given a set of tools, each with a name and a description of what it does and when to use it. At each step the model reads the task and those descriptions and picks a tool, then generates the arguments to call it — a search query, an API payload, a database lookup. It runs the tool, reads the result, and decides the next move. The quality of that choice rides heavily on the tool descriptions: vague descriptions invite wrong tool calls, which is one of the most common ways agents fail. On Chain of Thought, Vercel CTO Malte Ubl described giving a model descriptions of what its tools are good for, a goal, and up to 10 tool-using turns to work out the steps itself.

· Updated · Chain of Thought

Level 4: How AI systems are built · 4.3 Tools, MCP and agent architecture

AI AgentsAI Evaluation & Reliability

  • 5 episodes
  • 5 guest clips
  • 8 glossary terms
Three tool cards with a cursor picking the highlighted middle one, beside the words: it reads the label. How AI agents pick a tool.

In detail

Tools are described, not hard-coded

An agent doesn’t “know” your APIs. It’s handed a list of tools, each with a name and a plain-language description of what it does and when it’s the right choice. The Model Context Protocol’s tools specification is a concrete example: each tool has a name that is unique within its server, an inputSchema (a JSON Schema for the arguments it expects) and, optionally, a human-readable description. The protocol leaves the description optional, but it is the clearest guidance the model gets about when to use the tool, so write one. At each step the model reads the current task against those descriptions and decides which tool fits — or that no tool is needed and it can answer directly.

Selecting and calling

Once it picks a tool, the model generates the call: the search string, the JSON payload, the function arguments. It runs the tool, reads what comes back, and loops — using that result to decide the next action. Protocols like MCP standardize how those tools are exposed, so one agent can reach many systems through a consistent interface instead of a bespoke integration each time.

Vercel CTO Malte Ubl described that loop in episode 39 at 21:47: you give the model tools and a goal, tell it it can make “up to 10 turns using a tool,” and let it work out the sequence. It calls a tool, reads the response, and decides whether that helped or whether to call the tool again with a different query.

In a product the tool list can get long. Genspark co-founder Wen Sang said in episode 73 at 6:23, published in September 2026, that Genspark sits on top of more than 70 models, assigning planning, coding and media work to the models that are good at each. On top of that it built more than 150 in-house tools “so that models could call on these tools under the right context,” (6:23) and it pays for premium data sets such as PitchBook and Crunchbase to ground the output. Those figures describe Genspark’s own stack as he presented it. Episode 73 names Walrus Memory, Svix and Inngest as the Season 4 presenting sponsors; the reads are at 15:45, 25:40 and 41:10.

Why tool selection is where agents break

Tool choice is one of the most common failure points. If two tools have overlapping or fuzzy descriptions, the model can pick the wrong one; even with the right tool, it can pass bad arguments. Either way, the whole task derails from there. In episode 5 at 39:00, Chip Huyen named both failures as things to evaluate: the model tries to call an invalid tool, or uses the correct tool “but not with the right parameter.”

This is why “tool selection quality” is a metric worth measuring on its own, and why writing precise tool descriptions is one of the most direct ways to improve it. Anthropic’s tool-use documentation calls extremely detailed descriptions “by far the most important factor in tool performance”, and its engineering guide to writing tools warns that too many or overlapping tools can distract an agent, recommending namespaced names that mark the boundaries between them. For comparing models rather than your own tool set, the Berkeley Function Calling Leaderboard evaluates how accurately models call functions.

Marking tools that change things

Some tools only read; others edit, delete or send. In episode 48 at 29:25, Block’s Angie Jones described annotating tools as destructive so the agent knows which ones can change things, plus a setting in goose that lets the agent run non-destructive tools freely but ask the person’s permission before a destructive one. MCP has a field for such tool annotations, but its specification says clients must treat them as untrusted unless they come from trusted servers, so the permission check belongs in the client, not in the server’s self-description.

Disclosure: Episode 39 was sponsored by Galileo while Conor worked there. Episode 48 was sponsored by Galileo, the Season 3 presenting sponsor; it thanks Galileo at 49:33.

How an AI agent picks and calls a tool A task arrives. The agent does not know your APIs; it reads a shelf of tool cards, each with a name and a plain-language description of what it does and when to use it: search, database lookup, an API call. It matches the task to a description and picks one, or decides no tool is needed and answers directly. Then it generates the call, such as a search string, a JSON payload or function arguments, runs the tool, reads the result, and loops to decide the next move. Where it breaks: two fuzzy, overlapping descriptions can lead to the wrong tool, and even the right tool can be called with bad arguments; either derails the task. Protocols like MCP expose many tools through one consistent interface. Chip Huyen, episode 5: a lot of the time it will try to call an invalid tool, or use the correct tool but not with the right parameter. The agent picks a tool by reading its label It doesn’t know your APIs. It matches the task to each tool’s description, then writes the call. the task TOOL CARDS IT READS search what it does · when to use it database lookup what it does · when to use it API call what it does · when to use it picks WRITES THE CALL search( query: "…") runs it, reads the result decides the next move or no tool needed: answer directly WHERE IT BREAKS · FUZZY, OVERLAPPING LABELS (EXAMPLE) “gets data” “fetches info” the model can pick the wrong tool Even the right tool can get bad arguments. Measure tool selection on its own. Protocols like MCP: many tools, one consistent interface. Block’s goose also flags tools that can change or delete as destructive. “it will try to use the correct tool, but not with the right parameter.” Chip Huyen, episode 5, on what to evaluate in an agent. Destructive-tool flags: Angie Jones, episode 48.
Tool choice rides on the descriptions, so measure tool selection on its own. Chip Huyen names the wrong-tool and wrong-parameter failures in episode 5; Angie Jones describes goose’s destructive-tool flags in episode 48. Download the image

Hear it from the guest

“The other is whether it can call the right tool. So a lot of time, we'll try to call like an invalid tool. Or it will try to use the correct tool, but not with the right parameter.”
“Annotating tools that say like this tool is this word is strong, destructive. But that just means … it can change things. It can edit or it can delete or something like that. So helping your agent understand that this is a destructive tool, right?”
Watch on YouTube
“There's a lot of things which they make embarrassingly bad mistakes. A lot of them are related to, like, simple problems that, like, you can actually solve with a calculator or by running a little bit of code.”
Logan Kilpatrick, Google DeepMind EP 12 · around 7:31 · read the transcript
“Treat it like a junior engineer who isn't the smartest kid on the block, but has incredible patience with you.”
“We also built out 150 plus in-house tools to put them in place so that models could call on these tools under the right context to accomplish the real world work.”
Watch on YouTube

Quotes lightly edited to remove filler words.

Go deeper

From the conversation

This explainer is drawn from these episodes — each carries its full transcript.

Concepts in this explainer

Tool Use (Function Calling)Agent LoopAPI (Application Programming Interface)Browser AgentCoding AgentComputer UseReAct (Reason + Act)Structured Output