Lesson 311 lessons

Tool Use — Giving Agents Capabilities

Tools turn text generation into real action

Without tools, an agent can only produce text. With tools (web search, code execution, database queries, API calls), it can gather real information and cause real effects in the world.

Designing a good tool interface

A well-designed tool has a narrow, single purpose, a clearly documented input schema, and predictable, structured output. Vague, multi-purpose tools confuse the agent about when and how to use them.

Least-privilege tool access

Only give an agent tools it genuinely needs for its task, and scope permissions narrowly (read-only database access instead of full write access, for example). This limits the damage from an agent's mistake or misuse.

Key Takeaways

  • Tools let an agent act in the world, not just generate text.
  • Well-designed tools are narrow, documented, and predictable.
  • Give agents only the tools and permissions they genuinely need.
  • Least-privilege access limits the damage from agent mistakes.

Design a tool schema

Design (on paper) a tool schema for a `search_products(query, max_results)` function, including its narrow purpose and expected structured output format.