Skip to content

Function Calling

Function calling (often also referred to as tool use) describes the advanced ability of large language models (LLMs) to go beyond mere text generation. The AI recognizes on its own when its internal knowledge is not sufficient and autonomously decides to call and operate external digital tools – such as databases, APIs or web search engines.

How Does Function Calling Work Technically?

When a language model is equipped with tool use, it is given a kind of “toolbox” to take along. The process runs in milliseconds in four steps:

  1. Recognition: The user asks a question that requires live data (e.g. “What will the weather be like in Berlin tomorrow?” or “Is table 4 free tonight?”). The LLM recognizes that it does not have this data in its head.
  2. Generating the call (function call): The AI pauses text generation and instead creates a machine-readable command (JSON) that contains exactly the parameters for the external API (e.g. location: Berlin, date: tomorrow).
  3. Execution: The system in the background takes this command, queries the external software (weather app or table reservation system) and receives the raw data back.
  4. Formulating the answer: The raw data is passed back to the AI. The AI now translates this data into natural, human language and answers the user.

The Leap from Chatty Bot to Autonomous Agent

Without function calling, an artificial intelligence is trapped in a box. It can formulate wonderfully, draft emails or brainstorm ideas, but it has no hands to intervene in the real world.

Only through function calling does the paradigm shift from passive chatbot to active agentic AI (AI agents) take place. An agent does not just reel off knowledge, but proactively solves problems by operating the company’s tools.

Function Calling as a Core Competence of AI Phone Assistants

For the B2B use of an AI phone assistant, tool use is the absolute heart of value creation.

When a customer calls HeyMaria and wants to reschedule an appointment, the AI continuously uses function calling in the background. It calls the “calendar tool” to check available times. It then calls the “CRM tool” to match the customer number. Finally, it uses the “booking tool” to delete the old appointment and enter the new one. The caller notices nothing of these complex code queries in the background – they simply experience smooth, competent handling of their request in real time, which takes 100% of the load off the human staff.

Questions and answers

What is the difference between function calling and RAG?

RAG (Retrieval-Augmented Generation) is used by the AI to read static knowledge (such as company PDFs). Function calling, by contrast, is an active process: the AI specifically calls external functions (e.g. a calendar or a booking API) to obtain real-time data or trigger actions.

Why is function calling often also called "tool use"?

"Tool use" is the somewhat more general term from AI research. In practical software development and among providers of language models (such as OpenAI), however, "function calling" has become established as the precise, technical standard term for this process.

Can the AI cause uncontrolled damage through function calling?

No. The AI does not physically carry out the action itself, but "asks" the backend system to do so via code. Developers define precisely in advance which tools are available to the AI at all and which permissions it has in the connected software (e.g. the CRM).

Back to the glossary