noun · AI concept
Tool use
also called tool calling
The AI cannot press buttons, so it writes a note asking for one. Your app presses the button and tells it what happened.
A pattern where the model requests an action as structured output, the application executes it, and the result is returned to the model as context.
The harness tells the model which tools exist, and the model replies with a structured request naming a tool and its inputs. The harness runs it, then sends the result back as new input for the model's next turn.
Real-life example
You ask an assistant what the weather is. It has no idea, so it writes back a request: use the weather tool for your city. The app calls a weather service, gets the answer, and passes it back. The assistant then replies in plain words, and the model never touched the internet.
Playground
Ask for something and watch the model write a request while your app decides whether to run it.
Ask the assistant
~600 of 8,000 tokens are spent describing tools before you even ask.
What passes between them
- YouWhat is the weather in Paris right now?
The model only writes the request. Your app decides whether to run it.
The result goes back into the next request as new input, so the model can use it. Treat anything a tool returns as untrusted text.
Illustrative: scripted answers and made-up tool sizes. A real model decides for itself whether to call a tool, and which.
Where the analogy breaks
-
The model does not run the tool. It only asks. Your code decides whether to do it, so that is where permission checks belong.
-
Tools use up space before they are even called. Their names and descriptions are sent with each request, so a long tool list shrinks the room for everything else.
-
It can pick the wrong tool or the wrong inputs. Treat what it asks for as a suggestion that needs checking, not as a command.