Glossary Activate

What is function calling?

Function calling, also called tool use, is how an AI model asks other software to fetch data or take an action. The application describes each available tool in a schema. The model picks a tool and returns a structured request with the inputs filled in, and the application checks it, runs it, and hands back the result.

Also known as: tool calling, AI tool use, LLM function calling

What is function calling?

On its own, a language model can only produce text. Function calling lets that text be a request: run this query, look up this ad, start this workflow. The model writes the request in a fixed format, the application checks and runs it, and the result goes back to the model to use in its answer.

It's the basic mechanism behind every AI agent. An agent is, in large part, a model calling tools in a loop until the job is done.

How does function calling work?

  1. Describe the tools. The application gives the model a schema for each tool: a name, a description of what it does, and the inputs it takes, with their types.
  2. Choose. Given a request, the model decides whether a tool would help, and which one.
  3. Fill in the inputs. The model returns a structured call, such as a tool name plus a date range and an account ID.
  4. Check and run. The application validates the call, checks permissions, and runs it. The model never touches the system directly.
  5. Use the result. The output goes back to the model, which answers or calls the next tool.

What makes a good tool schema

  • A specific name. A name like get_campaign_spend tells the model more than query_data.
  • A description of when to use it. The model chooses from the description alone, so say what the tool is for and what it shouldn't be used for.
  • Typed, limited inputs. Dates as dates, and a fixed list of allowed values where there is one, so bad inputs fail early.
  • Errors that explain. An error that says what was wrong lets the model fix its own call.

What is an example of function calling?

Example

Answering a cost question with two tools

A strategist asks an agent why cost per acquisition rose last week. The agent calls a spend tool for the account and dates, sees that one campaign's spend doubled, then calls an ad-details tool for that campaign.

Each call runs with the strategist's own permissions. The agent combines both results into one answer and shows the data behind it.

Function calling vs. MCP vs. a plain API

TopicPlain APIFunction callingMCP
Who calls itCode a developer wroteA model, through the applicationA model, through any MCP-compatible client
How tools are describedAPI docs written for peopleA schema per tool, set up in each appA standard format any client can read
Works across AI toolsNeeds custom code each timeNeeds setup in each appYes

Why does function calling matter, and how do you keep it safe?

Tool use is what turns an assistant that explains into an agent that does. That also makes it where most of an agent's risk sits.

  • Run with the user's permissions. An agent should reach only what the person using it could reach on their own.
  • Start read-only. Let teams build trust with tools that read, then add tools that change things.
  • Approve consequential calls. Spending money, publishing, and deleting should wait for a person.
  • Keep the tool list short. The more tools a model can see, the more often it picks the wrong one.
How Alli does this

How does Alli do this?

Alli by PMG's MCP Server turns the Alli API into tools any MCP-ready agent can call, such as querying governed data, building dashboards, managing datasources, and triggering workflows. Tool definitions update as Alli's API specifications change, so there's no wrapper code to maintain.

Teams turn each tool on or off and keep the count where the agent works best. Every request carries the signed-in user's own authorization through OAuth 2.1, so agents only reach the tools and data that person can use, and teams can start with read-only questions before moving to actions.

Explore Alli MCP Server 
Read the analysis
AI agents Most agent failures are evaluation failures Teams test their agents, the agents pass, and then they fail in front of customers. The problem usually sits in what the tests asked, which is something a team can fix. By Nathan Barling · November 3, 2026 

Function calling (tool use) FAQ

Is function calling the same as tool use?

Yes. Function calling is the term some model providers use, and tool use or tool calling is the more general one. All three describe a model asking software to run an action.

Does the AI run the function itself?

No. The model only returns a request. The application decides whether to run it, runs it, and sends back the result.

How many tools should an agent have?

As few as the job needs. Each extra tool is another option to choose wrongly, so teams group related actions and turn off tools a given agent doesn't use.

What is the difference between function calling and MCP?

Function calling is the mechanism: the model requests a tool. MCP is a standard for publishing tools, so one set of tools works across many AI clients without custom setup in each.

Last updated Back to the glossary

See these ideas working on your data.

Book a walkthrough and we'll show you how Alli connects, defines, and acts on your data, live.

Book an intro