Tools and Function Calling

4 min
Audience
ages 10–15
Time
20 to 30 min
Module
1/5
Badge to earn
Toolbelt Technician

Today's mission

By the end of this lesson, you will be able to explain why an AI model needs tools, name four common kinds of tools, and describe what happens during a function call.

The idea in one picture

You know lots of facts in your head. But for some things, you reach for a tool: a calculator for big multiplications, a phone to call a friend, a map to find your way. You don't become the calculator. You pick it up, press the buttons, read the answer, and put it down. Then you use that answer to continue what you were doing. An AI model does exactly the same thing with its tools: it knows when it needs one, asks for it, reads the result, and carries on.

How it works

An AI model, on its own, can only produce text. It cannot look at today's weather, open a file or send a message by itself. Tools are how it reaches outside itself: to search the web, run code, read a file, or send a message. Function calling is the way the model asks for a tool to be used: instead of writing a normal sentence, it writes a small, precise request like get_weather("Paris").

Read the diagram from left to right. First the model realizes it is missing something. Then it calls the tool with exact inputs (here, the city name). The tool is real code that runs outside the model and fetches real data. The result is handed back to the model, which now has a true fact to work with instead of a guess.

Common tools:

  • Search — look something up on the web to get fresh, real information.
  • Code execution — run a calculation or a small program, so numbers are exact.
  • File access — read or write a file, like opening a notebook or saving a note.
  • APIs — talk to other services: check a calendar, send an email, query a database.

Examples:

  • "What's 847 × 392?" → instead of guessing, the model calls a calculator tool and gets exactly 332,024.
  • "Is it raining in Tokyo?" → the model calls a weather tool, because it cannot see the sky and its training data is from the past.

The important idea: the model doesn't pretend to know. It recognizes the limit of its own knowledge and asks a tool that can know.

Screen-free activity

The human function call. You need 3 people and some index cards.

  1. One person is the Model, one is the Tool (they hold a calculator, a dictionary or a thermometer), one is the User.
  2. The User asks a question the Model can't answer alone, like "What's 23 × 47?" or "How do you spell rhythm?"
  3. The Model must write a "function call" on a card: the tool name and the exact input, for example calculate(23 × 47). No chatting allowed!
  4. The Tool reads the card, does only what it says, and writes the result on the back.
  5. The Model reads the result and gives the final answer to the User. Swap roles and try a question that needs two tool calls in a row.

Key takeaways

  • A model alone can only produce text; tools let it check facts and act in the world.
  • Function calling is the precise way the model asks for a tool, with exact inputs.
  • The result of a tool comes back to the model, which uses it to answer or decide the next step.

A question for a grown-up

Which tools do you rely on every day that you could not "do in your head"? Should an AI agent be allowed to use every tool, or only some of them?

So what? Tools turn a model that only talks into an agent that can actually check facts and take action in the real world — and that's the difference between a good guess and a real answer.