Why descriptions decide the choice
A toy chooser that counts shared words. Real models compare meaning, but they depend on the description in the same way.
The model chooses and fills in tools using only their names, descriptions and JSON Schema parameters. Clear names, descriptions that say when to use the tool, and tight schemas (types, enums, required fields) are the main way to make tool use reliable.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 6 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write make_tool(name, description, properties, required) that returns the tool definition dict in the API shape, and print its function name.
Write tokens_estimate(tools) that returns the estimated tokens of a list of tool dicts as the length of their compact JSON divided by 4 (integer division).
Explain it without notes
What does the model actually see of a tool, and what follows for how you write them?
How do enum, required and description on a parameter each reduce errors?
What is the cost of a long tool list and how do you keep it under control?
Expected output
vague descriptions:
'What is 250 euros in rupees today?' -> no clear choice (score 0)
'Find news about the Pune metro' -> no clear choice (score 0)
clear descriptions:
'What is 250 euros in rupees today?' -> convert_currency (score 2)
'Find news about the Pune metro' -> search_web (score 2)