Skip to main content
AG-Kit provides a powerful framework for creating custom tools that extend your AI agents’ capabilities. Build specialized tools for your specific use cases with full type safety and seamless integration.

Tool Creation Patterns

Function Tools

Create tools from TypeScript/JavaScript functions:

Toolkits

Organize related tools into reusable toolkits:

Quick Start

Basic Tool Creation

Create a simple custom tool:

Tool Integration

Use custom tools with agents:

Tool Architecture

BaseTool Interface

All tools implement the standardized interface:

Tool Result Structure

Consistent result format across all tools:

Schema Validation

Use Zod for input validation:

Toolkit Architecture

Custom Toolkits

Create custom toolkits to organize related tools:

Using Custom Toolkits

Initialize and use custom toolkits with agents:

Toolkit Management

Use the toolkit manager for centralized toolkit management:

Toolkit Events

Listen to toolkit lifecycle events:

Tool Testing

Unit Testing

Test custom tools thoroughly:

Toolkit Testing

Test custom toolkits comprehensively:

Performance Optimization

Caching

Implement caching for expensive operations:

Connection Pooling

Reuse connections for better performance:

Next Steps