Designing Good Tool Schemas
Schemas
Part of: AI Agents & Tool Use
Give a model a tool named process with the description "does stuff" and it will call it at the wrong moments, with the wrong arguments, or not at all. Rename it get weather, describe it as "Return current weather for a given city," and the same model suddenly calls it perfectly. Nothing about the model changed. The schema did. A tool schema is the only thing the model sees about your tool, so it is the steering wheel for the whole agent. What it is A tool schema is the written description you hand the model for each tool: its name , a description of what it does and when to use it, and a list of parameters with their types and which ones are required. The model never sees your function's code. It chooses tools and fills arguments using the schema and nothing else. That makes the schema a contract. A precise schema gets reliable calls. A vague one produces the classic agent failures: calling the wrong tool, hallucinating arguments, or skipping a tool it should have used. How it works A good schema answers three questions clearly: what is this, when do I use it, and what must I pass. In code, a schema and the validation around it look like this: Two rules do most of the work. First,
Challenge: The Schema Validator