Skip to main content

Built-in Tools

See source code for the complete list of available tools and design philosophy.

Understanding the Tool System

The SDK’s tool system is built around three core components:
  1. Action - Defines input parameters (what the tool accepts)
  2. Observation - Defines output data (what the tool returns)
  3. Executor - Implements the tool’s logic (what the tool does)
These components are tied together by a ToolDefinition that registers the tool with the agent. The tools package (source code) provides built-in tools that follow these patterns.

Creating a Custom Tool

This example is available on GitHub: examples/01_standalone_sdk/02_custom_tools.py
Here’s a minimal example of creating a custom grep tool:
examples/01_standalone_sdk/02_custom_tools.py
Running the Example

Tool Registration

Tools are registered using register_tool() and referenced by name:

Factory Functions

Tool factory functions receive conv_state as a parameter, allowing access to workspace information:

Shared Executors

Multiple tools can share executors for efficiency and state consistency:

Output Formatting

The to_llm_content() property formats observations for the LLM:

When to Create Custom Tools

Create custom tools when you need to:
  • Combine multiple operations into a single, structured interface
  • Add typed parameters with validation
  • Format complex outputs for LLM consumption
  • Integrate with external APIs or services

Next Steps