🤖Tool Definition
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
Example code
json
{
"name": "get_weather",
"description": "Get the current weather in a city.",
"input_schema": {
"type": "object",
"properties": {
"city": { "type": "string" }
},
"required": ["city"]
}
}Common mistake
Key takeaways
- 1Name it. A short, clear name with no spaces.
- 2Describe it. What it does and when to use it.
- 3List the inputs. Each input, its type, and if it is required.