AI

What is Function Calling (Tool Use)?

Function Calling, also called Tool Use, is the mechanism that lets an AI model invoke a predefined external function or API in the middle of answering a request, instead of only generating text. It allows a model to fetch live data, run a calculation, or trigger an action, then incorporate the result back into its response.

TL;DR

Function Calling lets an AI model actually do something, like fetch live data or run a calculation, instead of just generating text based on what it already knows.

Why It Matters

Function Calling matters because it's the difference between an AI system that can only describe what it thinks is true and one that can go check. A model's training data has a knowledge cutoff and no access to a specific business's live systems, so without function calling it can only guess or hallucinate about current numbers. With it, the model can call a defined function, like get current revenue, get the real value, and then reason over accurate, current information. This is also the foundational capability behind AI agents, since an agent that can only generate text can't actually take multi-step action in the world; it needs function calling to interact with real systems. The reliability of an AI feature that claims to check your data, rather than just talk about it, depends directly on how well it uses function calling rather than filling gaps with a plausible-sounding guess.

Example

A user asks an AI Assistant what was our revenue last month. Instead of generating a guessed number from training data, the model calls a defined get_revenue function connected to the business's actual finance data, receives the real figure back, and then writes a response incorporating that verified number, rather than a hallucinated one.

Frequently Asked Questions

  • Answering from memory means the model generates a response based only on patterns learned during training, with no way to verify it against current reality. Function calling lets the model retrieve an actual, current value from a connected system before answering.

  • They're related but not identical. Function calling is a capability, the ability to invoke a tool. An AI agent uses that capability, often repeatedly across multiple steps, to pursue a broader multi-step goal.

  • No. It substantially reduces hallucination risk for the specific data the function retrieves, but the model can still misinterpret or misstate the result it gets back, which is why disclosed confidence and grounding remain important even with function calling in place.

  • In practice, almost anything with a defined interface: database queries, internal APIs, calculators, search tools, or third-party services, as long as the function is explicitly made available to the model.

  • It's what allows an AI Assistant to answer a question using a business's actual connected data, rather than generating a plausible-sounding but unverified number from general training knowledge.