Agentic

Tool Use

Giving a model the ability to call external functions (APIs, databases, code execution) during generation, with the model deciding when and how to invoke them.

First published April 14, 2026

Tool use (also "function calling") is the bridge between LLMs and the real world. The model doesn't call the tools directly -- your runtime does, after the model emits a structured tool-call request. Results come back as a message, and generation continues.

Tool-use quality separates junior-model agents from production ones. Good tool design has narrow, well-named functions with clear JSON Schema inputs. Bad tool design is a god-function with 20 optional parameters the model fills in wrong.

Example Prompt

Tools: search_docs(query), get_order(order_id), send_email(to, subject, body)

User: "Can you look up order #12345 for me and email a shipping update to [email protected]?"

Assistant should:
1. Call get_order("12345")
2. Compose the update from the result
3. Call send_email("[email protected]", "Your order #12345 update", <body>)

When to use it

  • The model needs real-time data it doesn't have (prices, inventory, user-specific state)
  • Actions need to happen (send, create, delete) not just answers
  • Computation the model is bad at (math, symbolic manipulation, code execution)
  • You want traceable, auditable agent behavior

When NOT to use it

  • The task is fully answerable from the prompt + model knowledge
  • You don't have a sandbox for tools that have side effects
  • Tool latency makes the UX unusable