Tool Design and Contracts

Function Calling

Function calling is the mechanism through which language models invoke external tools by outputting structured requests that match predefined function signatures, producing a JSON (JavaScript Object Notation) payload specifying the function name and arguments rather than a free-text description of intent. This structured interface is what transforms a language model from a text generator into an agent capable of taking real-world actions like reading files, querying databases, or calling APIs. The reliability of function calling depends heavily on tool definition quality: clear names, precise descriptions, and well-typed parameters with constraints make the difference between an agent that reliably selects the right tool and one that consistently misroutes.

connected to