The description is the tool's documentation, and it is loaded into the model's context on every call. OpenAI recommends describing the purpose of the function and each parameter, including its format and what the output represents. It also suggests an "intern test": could an intern use the function correctly given only what you gave the model? If not, add the answers to the questions they would ask (OpenAI function calling guide).
A strong description answers four questions: what the tool does, what it needs, what it returns and when not to use it. Most descriptions skip the last one. Compare:
{
"name": "search_knowledge_base",
"description": "Search internal policies, product specs and documented workflows. Use when the user asks how something is done at the company. Do not use for live data such as prices, stock or order status; use get_order_status for orders. Returns up to 5 passages ranked by relevance. An empty result means the answer is not documented.",
"input_schema": {
"type": "object",
"properties": {
"query": { "type": "string", "description": "Plain-language question or keywords, e.g. 'refund policy for annual plans'" },
"area": { "type": "string", "enum": ["billing", "shipping", "accounts", "product"], "description": "Optional filter by policy area" }
},
"required": ["query"],
"additionalProperties": false
}
}
The schema does as much work as the prose. Machine Learning Mastery puts it this way: a loose schema means the model guesses at constraints, while a tight one encodes them so no guessing is needed. Enums remove a whole class of plausible but invalid values (Machine Learning Mastery). OpenAI adds a related rule: use enums and object structure so invalid states cannot be expressed. Its example is toggle_light(on: bool, off: bool), which allows a call that is both on and off (OpenAI function calling guide).
Two more rules from OpenAI's guide save a lot of errors:
- Do not make the model fill arguments you already know. If your code already holds the order ID, define
submit_refund() with no parameters and pass the ID yourself.
- Combine functions that are always called in sequence. If one call always follows another, merge them.
Constraints that remove guesswork pay off quickly. AI/TLDR reports that Anthropic eliminated a class of file errors by requiring absolute paths instead of relative ones, because the model stopped guessing the working directory (AI/TLDR).