P

Tool Calling: Definition and Examples

Tool Calling is the ability of a language model to identify when it should use an external tool and to generate the structured parameters needed to invoke it, thus enabling it to act on the real world beyond simple text generation.

Full definition

Tool Calling is a mechanism by which a large language model (LLM) can interact with external tools — APIs, databases, calculators, search engines, or any other software function. Rather than just producing text, the model analyzes the user's request, determines that a tool is needed, and then generates a structured call (usually in JSON) containing the function name and its arguments.

Concretely, the developer defines a set of available tools by describing their name, purpose, and expected parameters. When the model receives a request, it autonomously decides whether to call one or more of these tools. The system then executes the call, retrieves the result, and sends it back to the model, which incorporates it into its final response to the user.

This paradigm transforms LLMs into true agents capable of concrete actions: checking real-time weather, performing precise calculations, querying a database, sending an email, or booking a flight. Tool Calling is the fundamental building block that makes it possible to move from a passive chatbot to an intelligent, connected assistant.

Tool Calling differs from simple "plugins" by its flexibility: the model dynamically chooses which tools to use, in what order, and with what parameters, based on the conversation context. It can also chain multiple tool calls (chaining) or execute several in parallel to answer complex requests.

Etymology

The term "Tool Calling" comes from programming vocabulary where a "function call" refers to invoking a function. OpenAI popularized the concept under the name "Function Calling" in June 2023, before the industry converged on the more generic term "Tool Use" or "Tool Calling" to reflect the diversity of tools beyond simple functions.

Concrete examples

Travel assistant with access to a booking API

Find me a Paris-Tokyo flight for April 15th, economy class, and book the cheapest.

Customer support agent connected to a CRM

What is the status of order #45892? If it is late, send an apology email to the customer with a 10% promo code.

Productivity assistant with access to calendar and messaging

Check my agenda for tomorrow and send a Slack message to the team to confirm the 2pm meeting.

Practical usage

In prompt engineering, Tool Calling is leveraged by defining clear and precise tool descriptions in the schema provided to the model: the more explicit the description about when and how to use the tool, the more relevant the model's calls. It is recommended to name functions intuitively, strictly type parameters, and provide examples in descriptions. On the system prompt side, one can guide the model by specifying its tool usage priorities and cases where it should ask for confirmation before acting.

Related concepts

Function CallingAI AgentsAPIRAG (Retrieval-Augmented Generation)MCP (Model Context Protocol)Tool ChainingJSON Schema

FAQ

What is the difference between Tool Calling and Function Calling?
The two terms are largely synonymous. "Function Calling" was the first name used by OpenAI, while "Tool Calling" or "Tool Use" became the industry standard term, adopted notably by Anthropic and Google. "Tool Calling" is more encompassing as it covers tools that are not simple functions, such as web searches or database interactions.
Does the model actually execute the tools itself?
No. The model only generates the call intention in a structured form (tool name and parameters). The host system (your application) actually executes the tool, retrieves the result, and sends it back to the model. This separation ensures you maintain full control over the actions performed.
How to improve the reliability of Tool Calling?
Three main levers: (1) write very explicit tool descriptions that clearly state when to use them and when not to, (2) use strict JSON schemas with types, enums, and descriptions for each parameter, and (3) limit the number of tools available simultaneously to reduce model confusion — ideally fewer than 20 active tools at a time.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.