Skip to main content

Lesson 3 · 11 min

Tool use done right

Tools are the agent's hands. Bad tool design wrecks more agents than bad models.

What separates a good tool from a bad one

Tools are JSON-schema'd functions the LLM can call. The model never executes them — your code does. So tools are an API contract between you and the model.

Four qualities of a good tool:

  1. Single purpose. search_web(query), not do_anything(action, params).
  2. Strict schema. Required fields, descriptions, no any types.
  3. Idempotent when possible — re-runs return the same result.
  4. Honest errors. Return structured errors the model can read and reason about.
  5. Cheap to call. A tool that takes 10 seconds turns a 5-step loop into a coffee break.