Brain labPlay → read → next · ~7 min

Tutorials · Chapter C (3/4) · ~7 min

Tools — when AI takes action

Play → read → next

Tools let an LLM do things in the real world — not just chat.

Playground

Tools: give AI hands

Choose which tool (or none) the AI should call.

What’s the weather in Dubai?

Recap

What you just did

You decided when chat is enough and when to call Weather, Calendar, Calculator, or none. That’s the heart of function calling.

Teach

How it works

  1. Model reads the user ask
  2. It picks a tool + arguments (or none)
  3. Your app runs the tool safely
  4. The result goes back so the model can answer with real data

LLMs are brains for language. Tools are hands for actions and live facts.

Use it

When you'd use this

  • “What’s the weather in Lisbon?” → weather API
  • “Add lunch tomorrow at 1” → calendar
  • “What’s 18% tip on 64?” → calculator (don’t make the model invent math)

Watch out

Watch out

Never let a model invent tool results. If the tool didn’t run, say so. Also keep auth and permissions in your code, not in freeform chat.

Try next

Try this next

Write two user messages: one that needs a tool, one that only needs knowledge. Label which is which.