← Advanced learning mapadvanced lesson · act

Tool calling

Give a model a small set of described actions while software keeps execution control.

  • 11 minutes
  • intermediate
  • Reviewed 2026-07-16
01

What is it?

Tool calling lets a model select a defined function and produce structured arguments. Application code checks the request, runs the operation, and returns the result.

02

Why does it matter?

It connects interpretation to real capability without giving the model unrestricted system access.

03

The mental model

The model proposes a tool and arguments; trusted software validates and executes the call.

04

A simple example

An order assistant calls getOrderStatus with a validated order ID, then explains the returned status.

05

What it is not

A tool description is not a security boundary. Permissions, validation, rate limits, approvals, and audit logs belong in software.

06

Learn this first

These ideas make the lesson easier to place.

  • Structured outputs
  • APIs
  • Permissions
07

Your first 60 minutes

Use one focused hour to make the idea concrete.

  • Define one read-only tool with a narrow schema.
  • Test valid and invalid arguments.
  • Return a clear tool error and see how the model responds.
08

Build this first

Create a two-tool assistant that can read an order and draft—but not send—a customer update.

09

When not to use it

Do not expose broad database access, shell execution, or irreversible actions when a narrower function can do the job.

10

What to learn next

Learn the agent loop and approval gates.