Tool Use & Environment

Tool Use

Let the LLM produce typed calls against an external toolkit instead of producing free-form text the surrounding system has to parse.

Problem

If the model speaks only free-form text, the host has to parse intent out of prose on every turn: the model invents field names, mis-spells operations, returns half-structured Markdown, or buries the actual command in an explanation. Invalid calls are caught only when downstream code crashes, and audit trails for which operations were attempted have to be reconstructed from natural language. The model is good at expressing intent and weak at producing perfectly typed structure without a schema to validate against.

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.

When to use

  • 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.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related