Skip to content
BENIBIX Learn

Tool Use (Function Calling)

AI🤖 AI AgentsAgent Abilities

Also known as Function Calling, Tool Calling, Tool Call

A way for a model to ask an app to run a tool. The app sends back what it got.

Think of it like

Think of it like asking a grown-up to reach the top shelf. You say what you need, and they get it for you.

Example

Emma asks her assistant what the weather is in Lisbon. The model calls a weather tool with the city, gets back 21 degrees and sun, and answers.

Why it matters

It is how models reach live data and take actions. Every agent is built on it.

Definition

Tool use is how a language model asks a program to run a function for it. The app first describes each tool with a name, a short note and the inputs it takes. When the model needs one, it replies with a tool call: the tool's name and the inputs, in JSON. The app runs the tool and sends the result back. The model then uses that result to carry on or to answer.

Example code

json
{
  "type": "tool_use",
  "name": "get_weather",
  "input": { "city": "Lisbon" }
}
The model does not fetch the weather itself. It sends this request, and the app runs the tool.
The model asks, the app runs the tool, and the result goes back to the model.

Common mistake

Writing vague tool notes. The model picks tools by their notes, so an unclear note means the wrong tool.

Key takeaways

  1. 1
    Model asks. Name and inputs.
  2. 2
    App runs it. The model never does.
  3. 3
    Result goes back. The model carries on.

Compare