Skip to main content

01 — Basic Tool

Define a tool with the @tool decorator.

02 — Tool Parameters

Use complex types, enums, defaults, and Pydantic models.

03 — Async Tools

Define async tool functions for I/O-bound operations.

04 — Tool Hooks

Run logic before and after tool execution.

05 — Tool Caching

Cache results to avoid redundant computation.

06 — Tool Dependencies

Inject services and context into tools.