Promptwatch Logo

Function Calling / Tool Use

Function calling, or tool use, lets an LLM request a defined function, such as a search or API call, with structured arguments that an app then runs.
Updated October 15, 2026
AI

Definition

Function calling, also called tool calling or tool use, is the ability of a language model to decide that it needs an external function, then return a structured request (a function name plus arguments in JSON) that the surrounding application executes. The result goes back to the model, which uses it to continue its answer. The model never runs the code itself; it only asks.

OpenAI added function calling to its API in June 2023, and every major model provider now supports it. A typical exchange has four steps. The developer describes the available tools, each with a name, a plain-language description and a JSON Schema for its parameters. The model reads the user's request and, if a tool would help, emits a call such as get_order_status with {"order_id": "A1042"}. The application runs the function and sends back the output. The model then answers, or calls another tool. OpenAI's function calling guide describes both JSON-schema function tools and free-form 'custom tools', plus tool search, which loads rarely used tool definitions only when needed.

The feature has grown well beyond single lookups. As of October 2026, GPT-6 Astra supports asynchronous tool calls, so the model keeps working while a slow function runs, and both GPT-6 Astra and GPT-6.1 Sol require OpenAI's Responses API for tool calling. Gemini 4 Argon supports function calling alongside built-in Google Search grounding, URL context and computer use. xAI's Grok 4.7 offers function calling plus server-side web search, X search and code execution. These built-in tools are themselves function calls: when an assistant searches the web, the model is generating a search query as a tool argument.

The Model Context Protocol standardizes the other side of the exchange. An MCP server publishes its tools once (listed through tools/list, invoked through tools/call, with JSON Schema inputs), and any MCP-compatible client can use them. The current specification, dated July 28, 2026, made the protocol stateless and added routing headers for gateways; MCP is now governed as a Linux Foundation project. Function calling is the model capability, MCP is the plumbing that makes tools portable across models.

Function calling matters for GEO in two ways. First, it is the mechanism behind AI search. The text of a search tool call, the grounding query, decides which pages are retrieved and which can be cited, so understanding how models phrase those queries tells you which wording your content needs to match. Second, AI agents increasingly reach brands through tools rather than web pages: a booking API, a product catalog exposed over MCP, or a pricing endpoint. If an agent can query your inventory directly while a competitor's data sits only in HTML, the agent has a reason to prefer you. Our comparison of AP2, ACP and MCP covers the protocols agents use for commerce.

Security is the main design constraint. Tool descriptions and tool outputs both enter the model's context, which makes them a channel for prompt injection. The MCP specification requires hosts to get explicit user consent before invoking a tool and to treat tool annotations from untrusted servers as untrusted. Keep tools narrowly scoped, validate every argument server-side, and log calls.

Examples of Function Calling / Tool Use

  • An airline's support assistant defines a `rebook_flight` tool with origin, destination and date parameters; when a customer asks to move a trip, the model fills in the arguments and the airline's backend makes the change.
  • A retailer exposes its live product catalog and stock levels as an MCP server, so shopping agents can check availability directly instead of scraping product pages.
  • A GEO analyst inspects the search tool calls ChatGPT makes for 'best espresso machine under 500 dollars' and finds the model searches for 'espresso machine reviews 2026', a phrase the brand's buying guide never uses.
  • A finance team uses GPT-6 Astra's asynchronous tool calls so the model keeps drafting a report while a 90-second database query runs in the background.

Terms related to Function Calling / Tool Use

Model Context Protocol (MCP)

Model Context Protocol (MCP) is an open standard for connecting AI apps to tools and data. Anthropic created it; the Linux Foundation's AAIF now hosts it.

AI

AI Agents

AI agents are AI systems that pursue a goal over many steps: they plan, use tools such as search, a browser or code, act on results and ask humans when needed.

AI

Agentic Workflows

Agentic workflows are multi-step processes where an AI model plans, calls tools, checks its own results and loops until a goal is met, with human checkpoints.

AI

Grounding Queries

Grounding queries are the search queries an AI model writes and runs to find sources for an answer. They decide which pages it reads and can cite.

AI

AI API

An AI API is a hosted interface for sending prompts, files and tool definitions to a provider's model, such as GPT-6, Claude or Gemini, and getting output back.

AI

Computer Use

Computer use lets an AI model operate a computer or browser through screenshots, clicks and typing. Anthropic, OpenAI and Google all offer it as of 2026.

AI

Prompt Injection

Prompt injection is an attack where text in a prompt, web page or file makes an AI model ignore its instructions. It is the top risk in OWASP's LLM Top 10.

AI

AI Agent Frameworks

AI agent frameworks are SDKs such as LangGraph, CrewAI, the OpenAI Agents SDK and Google ADK that handle tool calls, state and orchestration for AI agents.

AI

Agentic Search

Agentic search is AI search where an agent plans its own queries, reads and compares pages, and acts on the results to finish a task instead of answering once.

GEO

Frequently Asked Questions about Function Calling / Tool Use

Learn about AI visibility monitoring and how Promptwatch helps your brand succeed in AI search.

Function calling lets a language model ask an application to run a specific function. The developer defines the available functions with names, descriptions and parameter schemas. When the model decides one is needed, it returns the function name and arguments as structured JSON, the application executes it, and the result is passed back so the model can finish its answer.

Be the brand AI recommends

Monitor your brand's visibility across ChatGPT, Claude, Perplexity, and Gemini. Get actionable insights and create content that gets cited by AI search engines.

Promptwatch Dashboard