Function Calling Overview Function calling (also called tool use) lets LLMs invoke external functions to take actions or retrieve information. The model decides when and which tools to call; your code executes them and returns results. This enables true agentic workflows where the model can query databases, call APIs, perform calculations, and more. Core Concept The flow is always: 1. Define tools with schemas 2. Send messages + tool definitions to the model 3. Model returns a tool call (name + arguments) 4. Your code executes the function 5. Return the result to the model 6. Model uses the r…