Tool use (function calling)

Also called function calling, tool calling, tools

When an AI model asks to run a tool, like a search or a calculator, and uses the result in its answer.

Tool use, also called function calling, lets a language model work with external systems. A developer describes the available tools to the model, each with a name, a purpose and the inputs it takes. When the model decides a tool would help, it outputs a structured request, such as get_weather with city set to Paris. The application runs the tool and sends the result back, and the model continues with that information.

The model itself never runs code or reaches the internet directly. It only produces a request; the surrounding software decides whether and how to carry it out. That separation is important for safety: the application can validate inputs, require approval, or refuse certain actions.

Tool use is what turns a chatbot into an assistant that can check live data, do exact calculations, search documents, create calendar events or update a database. It is also the foundation of AI agents, which chain many tool calls together. Protocols such as MCP standardise how tools are described and connected, so the same tool can work across different AI apps.

Example

A user asks, "What will the weather be in Lisbon on Saturday, and should I pack an umbrella?" The model calls a weather tool with the city and date, receives "18°C, 70% chance of rain", and answers that yes, an umbrella is a good idea.

Common mistake

Writing vague tool descriptions. The model chooses tools based only on their names and descriptions, so "search" with no details gets used at the wrong times. Describe exactly what each tool does, when to use it, and what its inputs mean.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close