Function calling: how voice agents use tools during a call
Jaseem Abbas
- Published
How does function calling work on a voice agent?
Function calling works as a short loop inside the conversation: the model decides it needs an action, writes a request, your system runs it, and the model uses the result in its next reply. Anthropic's tool use documentation (read 15 November 2026) says tool use is also called function calling, and that the model asks for a tool while your code runs it and sends back the result. For what this makes of a voice agent, read what makes something an AI agent.
The Model Context Protocol specification for tools describes the same idea from the server side: a server lists tools, each with a name and a description of the inputs it takes, and the model can discover and call them based on what the conversation needs.
Picture Sana, who rings a Hyderabad pharmacy chain's help line to ask where her order is. She says the order number, and the agent picks an order lookup tool and sends the number. The pharmacy's system sends back the status as data, "out for delivery, arriving by 6 PM", and the agent says it in Telugu or English, whichever Sana is speaking. The pharmacy, the order and Sana are made up for this example.
What is the difference between function calling and tool calling?
There is none that matters for a buyer: both names describe a model asking software to run a function and use the result. Some providers say "functions" and others say "tools". The MCP specification uses "tools", and Anthropic's documentation says tool use is also called function calling.
What differs is where the tool lives. A function can be written into the agent's own code, an HTTP API can be called over the web, or an MCP server can offer a set of tools to any agent that connects to it.
How does AI change function calling?
It makes the choice of tool part of the conversation. A scripted voicebot runs the same lookup at the same step for every caller, while an agent decides during the call whether a lookup, a booking or a transfer fits what the caller just said. That is why function calling is the line between an AI voice agent that only answers and one that acts. See what a voicebot is for the answering side. For how tools behave while a caller waits, read tool calling on live voice calls.
The MCP specification adds a safety note: there should always be a human in the loop with the ability to deny tool invocations, and applications should make clear which tools are exposed. For a phone agent, that means choosing the tools carefully, trying each one before real calls, and handing sensitive requests to a person. See AI voice agent guardrails for how.
On Bananaflow, an agent can use these tools during a call:
- HTTP API tools you define, with a test panel to try each one first.
- Your own MCP servers.
- Transfer to a person, or to another agent.
- End call.
Agents also connect to 100+ apps in one click; read how Bananaflow agents act through HTTP tools, 100+ apps and your own MCP servers. You build the agent in a visual workflow builder. For a full build, read how to build an AI calling agent.
What does a function call send and return?
A function call sends a function name with its inputs, and gets back a result, usually as JSON. In the MCP specification, a tool call carries the tool's name and arguments, and the response carries content and a flag that says whether the call ended in an error. RFC 8259 defines JSON as a lightweight, text-based, language-independent data interchange format.
In the Hyderabad example, the request is the order number, and the result holds a status and an arrival window. The agent turns those two fields into one spoken sentence. When a result is sent to your own system after the call instead, that is a webhook. When the agent answers from your documents rather than a live system, see retrieval augmented generation.
FAQ
Frequently asked questions
What is function calling?
Function calling lets a language model ask software to run a function it was given, such as an order lookup, and use the result in its reply. The model picks the function and the inputs, and your system does the work.
Is tool calling the same as function calling?
Yes, in practice. Anthropic's documentation says tool use is also called function calling. Some providers say functions and some say tools, but the idea is the same: the model requests an action and gets a result back.
Does the model run the function itself?
No. The model only writes the request: a function name and its inputs. Your application or a server runs the function and sends the result back, and the model then uses that result to continue the conversation.
What is the difference between function calling and MCP?
Function calling is what the model does: it asks for a tool. MCP, the Model Context Protocol, is a standard way for a server to list its tools and run them, so one agent can use many servers without custom code for each.
What does function calling look like on a phone call?
A caller asks where her order is. The agent picks an order lookup tool, sends the order number, gets back the status as data and says it in plain words. The caller hears one smooth reply, not the lookup.
Which tools can a Bananaflow agent use during a call?
HTTP API tools you define, your own MCP servers, transfer to a person or to another agent, and end call. Agents also connect to 100+ apps in one click, so an agent can work with the tools your team already uses.
Can the agent call a tool with the wrong input?
It can, for example by mishearing a number on a noisy line. A good agent reads key details back before it acts, and a tool should check its inputs. HTTP tools on Bananaflow have a test panel to try them before real calls.
How does a tool send its answer back?
Usually as JSON, a plain text format for structured data defined in IETF RFC 8259. The agent reads the fields it needs, such as a status or a date, and turns them into a spoken sentence.
