AI glossary

What is Tool Use (Function Calling)?

Definition

Tool use, also called function calling, lets a language model request actions such as API calls, database queries or calculations by returning structured calls that your code executes.

On its own, an LLM can only produce text. Tool use lets it do things.

How it works

  1. You describe each tool to the model: a name, a description and a JSON Schema for its inputs.
  2. When the model needs a tool, it responds with a structured tool call, e.g. get_weather(city="Bengaluru"), instead of a normal answer.
  3. Your code runs the function and sends the result back.
  4. The model uses the result to continue or to answer.

Why it matters

Tool use is the foundation of AI agents. It connects models to live data (prices, inventory, order status) and lets them take actions (send emails, create tickets, update records).

Best practices

  • Write clear, specific tool descriptions; they drive tool choice.
  • Validate inputs and enforce business rules in code.
  • Return errors to the model so it can recover.
  • Require human approval for risky actions.

See it in code: Build an AI Agent in Python.

Free newsletter

The Agent Brief

One practical email a week on AI agents, RAG and generative AI, for builders and business owners. No hype, no spam.