Skip to content
BENIBIX Learn

Tool Definition

AI🤖 AI AgentsAgent Abilities

Also known as Tool Schema, Function Schema, Function Definition (LLM)

A note that tells a model how to call a tool. It lists the inputs.

Think of it like

It is like the label on a light switch. It says what the switch does and when to use it.

Example

Emma adds a weather tool to her app. Its note says the tool needs a city. It may also take a unit, celsius or fahrenheit.

Why it matters

The model picks tools by their description. A good one gets the right tool called with the right inputs.

Definition

A tool definition is the short note that tells a model a tool exists and how to call it. It has a name, a plain description of what the tool does, and a schema for its inputs. The schema lists each input, its type and which ones are required. The model never sees the tool's code, only this note. So a clear description is the main thing that decides whether the model picks the right tool.

Example code

json
{
  "name": "get_weather",
  "description": "Get the current weather in a city.",
  "input_schema": {
    "type": "object",
    "properties": {
      "city": { "type": "string" }
    },
    "required": ["city"]
  }
}
One tool, one required input. The model reads only these lines, never the code behind them.
The tool definitions ride along with the request. They are all the model knows about each tool.

Common mistake

Writing a one-line description. The model then guesses when to use the tool and what each input means.

Key takeaways

  1. 1
    Name it. A short, clear name with no spaces.
  2. 2
    Describe it. What it does and when to use it.
  3. 3
    List the inputs. Each input, its type, and if it is required.