AI Glossary

Browse our AI glossary for clear definitions of artificial intelligence, machine learning, and large language model terms, complete with use cases and examples to understand each concept in practice.

Browse AI Glossary (Alphabetically)

What is a Function Call?

Function call allows AI systems to perform actions by connecting to external tools or software. Instead of only generating text responses, AI can fetch information, send messages, schedule tasks, or update systems using function calls.

In simple terms, a function call allows AI to do things, not just talk about things.

Most systems, powered by LLMs, are designed to understand language and generate responses. These systems work well for answering questions or explaining information. However, they normally cannot access live data or interact with other software.

Function calling solves this problem.

With function calling, the AI model can recognize when a request requires real data or an action. Instead of giving a normal response, the model generates a structured request that tells the application which function should run.

These functions connect the AI system to tools such as API, databases, or internal software.

For example, if a user asks:

“What’s the weather in New York today?”

A basic language model might guess the answer based on past information. But a system using LLM function calling can request the current weather from an API and return the real result.

Because of this capability, function calling allows AI systems to interact with real software and complete tasks for users.

How Does Function Calling Work?

Function calling works through a simple process between the AI model and the application running it. The process usually follows these steps:

1. Functions Are Defined

First, developers define the functions the AI system can use.

Each function usually includes:

• a name

• a short description

• parameters that describe the inputs needed

For example:

get_weather(location)

create_calendar_event(date, time)

send_email(recipient, subject)

search_orders(customer_id)

The parameters show what information the function needs to work.

2. The Model Understands the Request

When a user sends a request, the AI model reads the prompt, which is the question or instruction given to the system.

The model then decides whether it should:

• answer normally

• generate a function call

For example, if a user says:

“Show me my last three orders.”

The AI understands that it needs data from a database.

Instead of generating a text answer, it prepares a function call to retrieve the information.

3. The Model Generates the Function Call

The model creates a structured request that includes the function name and the required parameters.

Example:

get_recent_orders(user_id: 4821)

This request tells the application which function should run and what information it needs.

The AI model itself does not run the function. It only generates the request, and the application executes the function.

4. The Application Runs the Function

Once the function call is created, the application executes it.

The system may connect to:

• API services

• databases

• business software

• productivity tools

5. The Model Creates the Final Response

After the function finishes running, the result is sent back to the AI model.

The model then turns the result into a clear response for the user.

Example response:

“Your recent orders include a wireless keyboard, a laptop stand, and a USB hub.”

Applications of Function Calling

Function calling is widely used in AI applications that require real-world actions or data retrieval. Common use cases include:

Customer Support

AI assistants can retrieve order information, update support tickets, or check account details by calling backend systems.

Voice Assistants

Voice AI systems can schedule meetings, set reminders, or control connected devices using function calls.

Marketing and Analytics

AI tools can retrieve campaign performance data, update dashboards, or generate reports by calling analytics APIs.

E-Learning Platforms

AI tutors can access course materials, generate quizzes, or track learner progress through connected educational systems.

Workplace Productivity Tools

AI assistants integrated into workplace software can create tasks, retrieve documents, or update project management systems.

Information Retrieval

Function calling allows AI models to convert natural language questions into structured queries that retrieve information from databases or knowledge systems.

Examples of Function Calling

Real-world scenarios make it easier to understand how function calls work in AI systems.
The following examples show how AI can connect to external tools and APIs to retrieve data or perform actions.

Checking Weather Information

A user asks:

“What’s the weather like in Paris today?”

The LLM understands that the question requires live information.

Instead of guessing the answer, the model generates a function call such as:

get_weather(location="Paris")

The application then sends a request to a weather API such as the OpenWeather API, which provides real-time weather data.

Once the API returns the result, the AI generates a response:

“The current temperature in Paris is 22°C with partly cloudy skies.”

Retrieving Customer Orders

A user asks a customer support assistant:

“Show me my last three orders.”

The AI recognizes that this information must come from a company database or e-commerce system.

It generates a function call such as:

get_recent_orders(user_id=0811)

The application retrieves the data using tools like the Shopify API or Stripe API, which allow businesses to access order and payment records.

The assistant then responds:

“Your recent orders include a t-shirt, trousers and a tie.”

Scheduling a Meeting

A user says:

“Schedule a meeting with the design team tomorrow at 10 AM.”

The AI extracts the meeting details and generates a function call such as:

create_calendar_event(date="tomorrow", time="10 AM")

The application sends the request to a calendar service like the Google Calendar API or Microsoft Graph API.

Once the event is created, the AI confirms the action:

“Your meeting with the design team has been scheduled for tomorrow at 10 AM.”

Voice AI Interaction

Function calling is especially useful in voice-based AI systems where users interact through spoken conversation.

For example, a user might say:

“Can you confirm my appointment for tomorrow?”

An AI Voice Agent converts the speech into text using speech to text. The LLM understands the request and generates a function call such as:

get_appointment_details(user_id=401)

The system retrieves the information through an API and returns the response. The reply is then converted into speech using TTS, so the user hears:

“Your appointment is scheduled for tomorrow at 10 AM.”

Developers can build similar workflows using the Murf API, where applications send text responses to generate spoken replies during real-time interactions.

Function calling helps AI systems move beyond answering questions. By connecting LLM models with APIs and software tools, AI systems can retrieve real data, automate tasks, and support real-world workflows.

Get in touch with us

Create voiceovers, build AI voice agents, and dub content into multiple languages. Powering 10 million+ developers and creators worldwide.