1:1 mentoring with Big Tech AI engineers
LLM & Agentic

How LLMs Call Tools

How LLMs use function calling and tool use — the mechanics behind tool-calling agents, from prompt engineering to structured output.

Last updated

02

How LLMs Actually Call Tools

LLMs never execute code — they emit structured text that your system runs. Master this one mechanism and every agent, from a support bot to a coding assistant, stops being magic and starts being architecture.

KEY INSIGHT

Tool calling is an illusion of action. The model outputs a JSON object that looks like a function call. Your code parses it, runs the real function, and feeds the result back as more text. The model never touches your APIs, databases, or file system — it only ever reads and writes tokens.

The Tool-Calling Loop — who does what

Related

More in LLM & Agentic

Get full access to all 87+ sections with code examples, diagrams, and interactive animations.

Unlock Premium