05 Tools
On its own, an LLM is a genius locked in a room with no phone. It can reason beautifully, but it only knows what it read during training. It can't look up today's price, read the file on your desk, send an email, or run a line of code. Tools are how you slide a phone under the door — and suddenly the genius can touch the real world.
The idea
Strip away the mystique and a tool is nothing exotic: it's a plain function — get_weather(), send_email(), run_python() — that reaches out and touches something the model can't reach on its own. The genius does the thinking; the tool does the doing.
Here's the part that feels like magic. Modern LLMs are specifically trained to look at a list of tools you hand them and decide which one to call, when to call it, and with what arguments — all on their own. You describe the tools; the model orchestrates them. That skill has a name: function calling, or tool use. It's the single ability that turns a chatbot into an agent.
The model never runs the tool itself. It just says "please call get_weather("Tokyo")," your code runs it, and you hand the answer back. The LLM is the brain deciding what to do; your program is the hands that actually do it.
The superpower
Ask a genius on the phone for two facts and they'd make two calls — but a good agent makes both calls at the same time. When a question needs several independent facts, the model can fire off multiple tool calls in a single breath and wait for them together. Doing it one-after-another would take twice as long for no reason. Watch it grab Tokyo and London simultaneously.
The toolbox
Almost every tool an agent uses falls into one of five buckets. Learn the buckets and you'll instantly know what an agent could do the moment you see its toolbox.
Reach out and fetch fresh facts the model never saw in training.
Offload exact math and logic instead of guessing at numbers.
Read what's on your disk and write results back out.
Actually do things in the world on your behalf.
Tools that call other AI — the agent reaching for more brains.
Real agents carry a handful from several buckets — search to learn, Python to crunch, email to deliver — chained together in one loop.
The craft
Here's what trips up every beginner: the model picks a tool based entirely on the description you wrote for it — nothing else. It can't peek inside the function. A vague description and the model guesses wrong or ignores the tool completely. A precise one and it reaches for exactly the right tool, every single time. Writing tool descriptions is less coding and more writing clear instructions for a brilliant new intern.
"get_data — gets some data"
The model has no idea what data or when to use it. It either skips the tool or calls it with garbage arguments and hopes.
"get_stock_price(ticker) — returns the current USD price for a stock ticker like AAPL. Use for any live market-price question."
Now the model knows exactly what it does, what to pass in, and when to reach for it. Right tool, right arguments, first try.
In real code
You write an ordinary function, describe it clearly, and hand its schema to the model. When the model decides it needs that tool, it doesn't run anything — it hands you back a tool call, and your loop executes it. Notice how the docstring becomes the description the model reads.
def get_weather(city: str) -> str: """Get the current weather for a city. Use this for any live weather question. Args: city — the city name, e.g. "Tokyo".""" return weather_api.lookup(city) # touches the outside world # the schema the model actually reads to decide schema = {"name": "get_weather", "description": get_weather.__doc__, "args": {"city": "string"}} reply = llm(messages, tools=[schema]) # THINK — model chooses if reply.tool_call: # model asked for a tool… out = get_weather(**reply.tool_call.args) # …your loop runs it
Tools are what turn a smart text-predictor into something that can actually do things — look things up, crunch numbers, read your files, and act in the world.
Chapter 5 in one breath
An LLM alone is a genius with no phone. A tool is just a function it can call to touch the world, and function calling lets the model choose which one, when, and with what arguments — even firing several in parallel. They come in five flavors, and the model picks them entirely from the descriptions you write. Give the genius a phone and it stops just talking and starts doing. Next: where does it keep everything it learns?
A matching slide deck with speaker notes — press S for notes, F for fullscreen.