Tool CRUD & Search
Updated
Manage the full lifecycle of tools in your registry — create tools with descriptive names, list and filter them, update properties, delete them, and discover tools using hybrid semantic search.
list(params?)
Retrieve a paginated list of tools. Optionally filter by category or search keyword.
Signature:
list(params?: ToolListParams): Promise<ToolListResponse>Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
// List all tools
const { data: tools, total } = await chaos.tools.list();
console.log(`${total} tools registered`);
for (const t of tools) {
console.log(`${t.name}: ${t.description ?? '(no description)'}`);
}
// Paginate
const page2 = await chaos.tools.list({ page: 2, limit: 10 });
// Filter by category
const defiTools = await chaos.tools.list({ categoryId: 'cat-defi-123' });
// Keyword search
const priceTools = await chaos.tools.list({ search: 'price' });Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
ToolListParams
| Field | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number |
limit | number | No | Results per page |
categoryId | string | No | Filter by category ID |
search | string | No | Keyword search filter |
create(params)
Register a new tool. At minimum, provide a name. Additional properties are accepted and passed through to the API.
Signature:
create(params: CreateToolParams): Promise<Tool>Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
const tool = await chaos.tools.create({
name: 'liquidity-analyzer',
description: 'Analyzes liquidity depth and slippage across Uniswap, Curve, and Balancer pools',
});
console.log(`Created: ${tool.id}`);
console.log(`Name: ${tool.name}`);
console.log(`Description: ${tool.description}`);Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
update(toolId, params)
Update a tool's properties. Returns a confirmation message.
Signature:
update(toolId: string, params: UpdateToolParams): Promise<{ message: string }>Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
const result = await chaos.tools.update('tool-id', {
description: 'Updated: analyzes liquidity across all major DEXes including Uniswap V4',
});
console.log(result.message);Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
delete(toolId)
Remove a tool from the registry.
Signature:
delete(toolId: string): Promise<void>Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
await chaos.tools.delete('tool-id');
console.log('Tool deleted');Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
searchHybrid(params)
Run a batch semantic + keyword hybrid search across all tools. Pass multiple queries at once — each returns its own ranked list of matching tools.
Signature:
searchHybrid(params: BatchHybridSearchParams): Promise<QueryToolSearchResult[]>Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
import { Chaos } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
const results = await chaos.tools.searchHybrid({
queries: [
'fetch real-time token prices',
'analyze DEX liquidity depth',
'monitor wallet balances on Ethereum',
],
});
for (const r of results) {
console.log(`\nQuery: "${r.query}"`);
for (const tool of r.results) {
console.log(` ${tool.name}: ${tool.description ?? ''}`);
}
}Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
Was this helpful?