Skip to main content
← Back to techniques

Tool calling

Reasoning

Level 3 · Agentic & composite

Define which tools the model can use, when to use them, and how to handle failures — distinct from ReAct's reasoning loop.

Tool calling defines the static contract of what tools/functions are available to the model, when each should be used, what parameters they need, and what should happen if a call fails — as opposed to ReAct, which is the dynamic loop of reasoning, acting, and observing results turn by turn. In practice the two are often used together: tool calling defines the toolbox, ReAct defines how the model works through it step by step. Keeping them as separate techniques makes it clearer which part of an agentic prompt you're improving.

When to use it

Use it whenever a prompt gives the model access to external functions, APIs, or tools — defining the toolbox explicitly (rather than describing tools loosely in prose) reduces incorrect tool selection and malformed calls.

When to avoid it

Avoid it for prompts that don't involve any external tool or function call — there's nothing to define.

Advantages

  • Makes tool selection and parameters explicit and checkable, rather than implied
  • Separates 'what tools exist and how they work' from 'how the model should reason while using them' (ReAct) — easier to debug which part is failing
  • Reduces malformed or inappropriate tool calls by stating the policy for when to use each tool

Disadvantages

  • Adds no value without ReAct or an equivalent reasoning loop to actually use the tools defined here
  • The tool list and parameters must stay in sync with what's actually available — a stale definition causes real failures, not just prompting mistakes

Examples

Task: answer questions about the weather and simple currency conversion.

Available tools:
- get_weather(city) — returns current weather for a city
- convert_currency(amount, from, to) — converts an amount between currencies

Use a tool only when the question genuinely requires live or calculated data you don't already know. If a tool call fails, say so explicitly and answer with the best available information instead of pretending the call succeeded.

Try it

Fill in the placeholders below and see the compiled prompt update live.

What you want to achieve.

List the tools/actions the model can use, one per line (e.g. search_web(query), get_weather(city)).

When should a tool be used instead of answering directly?

What should happen if a tool call fails or returns an error?

16
Words
120
Characters
0/4
Placeholders filled
1 min
Reading time
Quality score6
  • Completeness0
  • Clarity0
  • Context0
  • Specificity0
  • Constraints0
  • Format0
  • Output0
  • Constraints note0
  • Success criteria0
  • Scope focus100
  • Verification step0
  • Negative example0
  • Confidence0
  • Placeholder syntax100
  • Markdown structure0
Suggestions
  • Fill in the remaining placeholders.
  • Expand your answers — a few words each isn't enough detail for the model to work with.
  • Add background context so the model understands the situation.
{{OBJECTIVE}} Available tools: {{AVAILABLE_ACTIONS}} Use a tool only when: {{WHEN_TO_USE_A_TOOL}} If a tool call fails: {{ON_TOOL_FAILURE}}
AI Assistant

Jump to a page…

Navigation