Tool Use
Let the LLM emit typed tool calls instead of free-form text — deterministic execution outside the model, schema validation at the boundary.
Intent & Description
🎯 Intent
Replace fragile text-parsing with typed, validated tool calls for any action that touches the outside world.
📋 Context
Your agent needs to read customer records, cancel orders, write to a database, render charts, or post to a channel. The model alone can’t do these safely, and parsing intent from free-form text is brittle and error-prone.
💡 Solution
Define a typed tool palette. The model emits tool calls conforming to a JSON Schema; the host validates and executes; results return as structured tool results. The agent becomes a thin client of a deterministic toolkit — the toolkit, not the model, is the locus of capability and audit.
Real-world Use Case
- The model must affect external state or query authoritative systems.
- Operations are typed and a JSON Schema can describe them.
- Audit and validation need to live outside the model.
Source
📌 TL;DR
Model emits typed tool calls → host validates → host executes → structured result back. Clean boundary, auditable actions, no free-form text parsing.
Advantages
- Invalid calls are rejected at the schema layer rather than as runtime errors.
- The toolkit — not the model — is the source of truth for capability and audit.
- Tools can be tested and versioned independently of prompts.
Disadvantages
- Tool palette design becomes the bottleneck — bad tool definitions propagate to every call site.
- Models with weaker function-calling support drift; schema strictness must be tuned per model.