Glossary · Definition
Function calling
Function calling is the API pattern where you define functions (with JSON schemas), the AI model decides when to call them and with what arguments, your code executes them, and the result returns to the model. Same concept as 'tool use.'
Definition
Function calling is the API pattern where you define functions (with JSON schemas), the AI model decides when to call them and with what arguments, your code executes them, and the result returns to the model. Same concept as 'tool use.'
What it means
Introduced by OpenAI in 2023, now standard across Anthropic, Google, Mistral, DeepSeek, Cohere. Pattern: define each function as { name, description, parameters: JSON schema }. Pass these alongside your prompt. Model returns either text (no function needed) or a structured function-call object. Your code dispatches, executes, returns the result, model continues. Modern frameworks (Vercel AI SDK, LangChain, Anthropic Agent SDK) abstract this.
Advertisement
Why it matters
Function calling is the bridge between LLMs and the rest of your software. It's what makes LLMs useful for anything beyond chat — query databases, send emails, run code, control deployments. Reliability depends on how well you describe each function (good descriptions + clean parameter docs make a huge difference).
Related free tools
Frequently asked questions
Function calling vs MCP?
Function calling is the protocol-level pattern. MCP is a portable layer on top: define your tools as MCP servers, they work across all clients.
Best for reliability?
Claude Sonnet 4.6 + Opus 4.7 lead on tool-use reliability over long loops. GPT-5 is competitive.
Related terms
- DefinitionTool use (AI)Tool use (also called function calling) is the ability of an LLM to invoke external functions — web search, calculator, code execution, API calls — instead of just generating text. Returns the result for the model to incorporate.
- DefinitionMCP (Model Context Protocol)MCP (Model Context Protocol) is an open standard for connecting AI assistants to external tools and data sources. Think USB-C for AI integrations: write a server once, it works in Claude, ChatGPT, Cursor, Zed, Goose, etc.
- DefinitionAI agentAn AI agent is an LLM running in a loop: think → call a tool → observe the result → think again. The loop continues until the task is done or a stopping condition is hit.