Function Calling for Structure
ToolSchema
Part of: Structured Outputs
Instead of asking a model "please reply in JSON and pretty please use these keys," you hand it a function and say: "call this." The model responds not with prose, not even with loose JSON, but with the exact arguments that function expects. Function calling is JSON schemas with a steering wheel attached, and it's how serious AI features get reliable structure. What it is Function calling (also called tool use ) lets you describe a function to the model, its name, what it does, and a schema for its parameters. The model, instead of answering in text, returns a structured request to call that function with specific arguments. You define the shape; the model fills it. The description of that function and its parameters is the tool schema . It is a JSON Schema that names each argument, gives its type, and marks which are required. The model treats it as a binding contract for how to respond. How it works The flow has a clean shape: 1. You define a tool. A name, a plain-language description of when to use it, and a parameter schema with typed fields. 2. You send it with the prompt. "Extract the order details from this email" plus the record order tool. 3. The model returns a tool call.
Challenge: Route the right tool