6.1 What is Tool Use? — LLMs Can Delegate

Giving AI hands and a brain.

🎯 Core Goals

  • Understand that LLMs can call external software to solve their limitations.
  • See the power of “delegation” for math, search, and data access.

LLMs are great at language but bad at math and facts. Tool Use lets them delegate to a calculator or a search engine instead of guessing.

👁️ Visuals & Interactives

LLMs Can Delegate

See how an LLM uses a calculator to avoid "guessing" math.

Without Tools
Question: "What is 123 × 456?"
AI Logic: "I remember seeing numbers like this. It's probably around 50,000..."

Output: "123 × 456 is 56,128." (Wrong! It guessed.)
handyman Tool Call
With Calculator Tool
Question: "What is 123 × 456?"
CALL: calculator.multiply(123, 456)
RESULT: 56088
Output: "123 × 456 is 56,088." (Correct! Exact calculation.)

By delegating to a calculator, the LLM stops being a "statistical guesser" and becomes a precise processor.

But wait — how does the LLM actually "use" a tool?

Step 1 — LLM Output
I need to calculate this.
[tool_call: calculator.multiply(123, 456)]
Let me use the result...

The LLM only outputs text — including the trigger phrase. It never "runs" anything itself.

arrow_forward
Step 2 — Executor Intercepts
Detected: tool_call
Running: calculator.multiply(123, 456)
Result: 56088

A separate program reads the trigger, executes the real action, and sends the result back.

🎮 Think of it as Simon Says: the LLM is Simon — it only says the command. Someone else actually carries it out.

🎮 The Simon Says Trick

Here’s the key insight most people miss: an LLM never actually “does” anything.

It only ever outputs text. That’s it. No clicking, no downloading, no running code — just text.

So how does it “use” a calculator? Think of the game Simon Says. When Simon says something, someone else carries out the action. The LLM is Simon — it only says the instruction. A separate program listens for the trigger and actually executes the task.

In practice, it looks like this:

LLM outputs: [tool_call: calculator.multiply(123, 456)]

That’s just text with a special trigger pattern. Another program reads it, runs the calculation, and feeds the result back. The LLM then reads that result and continues writing.

“Simon says, download data from example.com” — the LLM says it; the executor does it.

📝 Key Concepts

  • Delegation: The LLM decides WHICH tool to use and WHAT to ask — but the tool does the heavy lifting.
  • Common Tools: Calculators, web search, code execution, file reading, and database queries.
  • Trigger Text: Tool calls are just specially formatted text that a surrounding system intercepts and runs.
  • Incorporating Results: Once the tool finishes, the LLM reads the result and incorporates it back into your chat.

What is an API? An API (Application Programming Interface) is like a restaurant menu. You don’t go into the kitchen — you look at the menu, place an order, and get food back. An API is the “menu” that lets software programs talk to each other.

🧠 QUIZ

When an LLM "uses a calculator," what actually happens?

The LLM performs the math internally using a built-in module
The LLM outputs specially formatted text that an external system intercepts and executes
The LLM sends the calculation to another AI model that specializes in math
arrow_back Next arrow_forward