Function Calling & Tool Use Language
5 exercises — Describe function schemas, tool selection decisions, parallel calls, error handling, and tool result integration precisely.
0 / 5 completed
Quick reference: Function Calling
- function schema — JSON object with name, description, parameters, required — what the model reads to decide when to call a tool
- tool selection — the model's decision to invoke a specific function based on the description
- parallel tool calling — requesting multiple independent functions in a single model response
- tool result — the message containing the function's return value, passed back into the context
- grounded response — an answer synthesised from tool-returned data rather than parametric memory
1 / 5
A teammate reviews a function schema and says: "The description field is too vague — the model picks the wrong tool because it can't tell when to call this function versus the search one." What makes a function description effective for tool selection?
Function descriptions are the model's primary signal for tool selection.
When an LLM chooses which function to call, it relies almost entirely on the description field — not the parameter names or any runtime context. A vague description (e.g., "gets data") causes the model to guess, leading to wrong tool calls or missed calls.
Effective descriptions answer three questions: (1) What does this function do? (2) When should the model call it vs. other available functions? (3) What does it return? For example: "Searches the product catalogue by keyword. Call this when the user asks about a specific product or SKU. Returns a list of matching products with IDs and prices."
Including source code wastes tokens; single-word descriptions remove all semantic signal; and cramming edge cases into parameters confuses the schema rather than clarifying intent.
Key vocabulary:
• function schema — the JSON object describing a callable tool: name, description, parameters, required
• description field — the natural-language text the LLM reads to decide when to call the function
• tool selection — the model's decision of which registered function (if any) to invoke given the conversation
• parameters — the JSON Schema object defining the function's input arguments and their types
When an LLM chooses which function to call, it relies almost entirely on the description field — not the parameter names or any runtime context. A vague description (e.g., "gets data") causes the model to guess, leading to wrong tool calls or missed calls.
Effective descriptions answer three questions: (1) What does this function do? (2) When should the model call it vs. other available functions? (3) What does it return? For example: "Searches the product catalogue by keyword. Call this when the user asks about a specific product or SKU. Returns a list of matching products with IDs and prices."
Including source code wastes tokens; single-word descriptions remove all semantic signal; and cramming edge cases into parameters confuses the schema rather than clarifying intent.
Key vocabulary:
• function schema — the JSON object describing a callable tool: name, description, parameters, required
• description field — the natural-language text the LLM reads to decide when to call the function
• tool selection — the model's decision of which registered function (if any) to invoke given the conversation
• parameters — the JSON Schema object defining the function's input arguments and their types