---
title: "Explain what actually happens when an LLM calls a tool: what the model sees, what it emits, and who executes what."
url: https://gurkanozkan.ai/learn/questions/applied-llm-agt-01/
markdown: https://gurkanozkan.ai/learn/questions/applied-llm-agt-01.md
kind: question
role: Applied LLM
stage: Technical
difficulty: Easy
json: https://gurkanozkan.ai/api/learn/questions/applied-llm-agt-01.json
robots: noindex
---

# Explain what actually happens when an LLM calls a tool: what the model sees, what it emits, and who executes what.

Applied LLM · Technical · Easy

Theme reported publicly: [PolyAI](https://job-boards.eu.greenhouse.io/polyai/jobs/5032627101), [Cohere](https://builtin.com/job/forward-deployed-engineer-agentic-platform-uk-europe/9328104)

## Answer

*Model answer, written in a candidate's voice*

### In short

- Tool specs are serialised into context via the chat template; the model is trained to emit structured call tokens
- The application parses, validates, executes, appends tool results, and calls the model again until a final answer
- The model never executes anything; the app owns auth, side effects, and error handling
- Parallel calls, forced tool choice, and structured output via a tool are supported patterns
- Failure points include invalid arguments, invented tool names, and oversized tool outputs

### In full

At a high level, the model does not run tools; it is given tool names, descriptions, and JSON schemas through the chat template, and it is trained to emit structured call tokens with arguments rather than to perform side effects. The application then parses and validates those arguments, checks permissions and auth, executes the tool, appends the result as a tool message, and calls the model again until the model produces a final answer. In one turn the model may emit several calls, which the app can run in parallel; the app can also set tool choice to require some tool call or force one specific tool, and defining a tool whose input schema is the desired output is a common way to get structured output. The model never executes anything itself; the application owns execution, side effects, retries, and error handling. The main failure points are invalid arguments, invented tool names, and oversized tool outputs, so the app should validate strictly, reject or repair bad calls, and truncate, summarise, or paginate large results before feeding them back.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Tool names, descriptions and JSON schemas are serialised into the context through the chat template; the model is trained to emit structured call tokens
- The application parses and validates arguments, executes, appends the result as a tool message and calls the model again until a final answer
- The model never executes anything; the application owns auth, side effects and error handling
- Mentions parallel calls, forced tool choice, structured output via a tool
- Failure points: invalid arguments, invented tool names, oversized tool outputs

## Common mistakes

- Implying the model has direct API access
- executing calls without validating arguments

## Topic guides

- [Agents and tool use](https://gurkanozkan.ai/learn/topics/agents.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
