Definition
An LLM capability that allows the model to invoke predefined functions or APIs as part of its response, enabling it to take real-world actions.
In Depth
Function calling (also called tool use or tool calling) is an LLM capability that lets a model invoke predefined functions or APIs as part of generating its response. You describe the available functions to the model — name, purpose, and JSON-schema parameters — and the model decides during inference when calling one is appropriate. It returns structured JSON arguments instead of free-form text; your code parses those arguments and executes the function, then feeds the result back to the model so it can continue the conversation with the new information.
This is the foundation of agentic AI: it bridges the gap between a model's reasoning and the outside world. Without function calling, a chatbot can only answer from what it already knows; with function calling, it can query a database for live data, create a record in a CRM, send an email, hit a payment API, or chain multiple actions together to complete a multi-step task.
The standard implementation pattern is a tool loop: send the user message + tool definitions → model returns a tool call → execute the tool → send the result back to the model → repeat until the model returns a final text response. OpenAI, Anthropic, and Google all expose function calling through compatible-ish APIs, and Pydantic-based schema validation has become the de facto pattern for defining tool signatures in Python.
Example Usage
Defining a 'create_invoice' function so Claude can generate NetSuite invoices when a user asks 'Bill Acme Corp $5,000 for consulting.'
Business Context
Function calling transforms chatbots from information-only tools into action-taking agents that can query databases, update records, send emails, and trigger workflows.
Related Terms
Agentic AI
AI systems that can autonomously plan, execute, and iterate on multi-step tasks with minimal human i...
Generative AI
AI systems that can create new content including text, images, code, and data based on training patt...
Inference
The process of using a trained AI model to make predictions or generate outputs on new data — the 'p...
Large Language Model
An AI model trained on vast amounts of text data capable of understanding and generating human-like ...
Middleware
Software that connects two or more applications, translating data formats and managing communication...
Also Known As
Tags
Quick Info
Need help implementing this in your business?
Get Started