← Lessons

quiz vs the machine

Gold1460

Machine Learning

Tool Use Prompting

Letting a model call functions to act beyond text.

6 min read · core · beat Gold to climb

Giving the model hands

Tool use lets a model call external functions, such as a calculator, a search API, or a database query. You describe the available tools and their inputs, and the model decides when to call one and with what arguments. The system runs the tool and returns the result for the model to continue.

How it flows

  • The prompt lists each tool name, its purpose, and its input schema.
  • The model emits a structured call when it needs a tool.
  • Your code executes the call and feeds the result back.
  • The model incorporates the result into its answer.

Why it matters

  • Tools provide fresh facts and exact computation the model lacks.
  • They let the model take actions in real systems.
  • They reduce hallucination by delegating what the model cannot reliably do.

Designing tools well

Keep tool descriptions precise so the model picks the right one. Validate arguments before executing, since the model can produce malformed or unsafe calls. Limit each tool to a clear, narrow job to make behavior predictable and safe.

Key idea

Tool use prompting describes callable functions so the model can fetch facts, compute, or act, with precise descriptions and validated arguments keeping calls reliable.

Check yourself

Answer to earn rating on the learn ladder.

1. In tool use prompting, who decides when a tool is called?

2. Why validate tool arguments before executing?