Skip to main content
Choose between functions, classes, remote sources, or packages when extending agent capabilities.
The user picks a tool style, registers it, and confirms the agent selects the right tool.

How It Works


How to Create Tools as Functions

1

Define Simple Function

2

Use with Agent

How to Create Tools as Lambda Functions

1

Define Lambda Tool

2

Use with Agent

How to Create Tools from External Libraries

1

Wrap Library Function

2

Use Wrapped Tool

How to Create Tools in tools.py File

1

Create tools.py

2

Reference in Template

How to Create Tools in a Package

1

Create Package Structure

2

Define Tools in Module

3

Export in __init__.py

4

Use as tools_source

How to Create Tools with Decorators

1

Use Tool Decorator

2

Use with Agent

How to Add Tools via CLI

1

Add Package Tools

2

Add Local File

3

Add from GitHub

4

Verify Added Tools

How to Create Tools with Choice Parameters

1

Use Literal for Fixed Options

See the Tool Parameter Types page for complete guide on using Optional, Union, Literal, Enum, List, and Dict types.

Tool Creation Methods Comparison

Best Practices

The function-plus-decorator path has the lowest complexity and covers most tools — reach for classes only when you need shared state.
When a tool holds a connection or cache, a class keeps that state tidy; pass the bound methods to the agent’s tools list.
Adapt a library call into a typed, docstringed function so the model gets a clean schema without the library’s full surface.

Create Custom Tools

Detailed walkthrough per tool style

Remote Tools from GitHub

Load tools from remote sources