executeTool
codebolt.tool.executeTool(toolbox: string, toolName: string, params: object): Promise<undefined>
Executes a specific tool from a configured toolbox with provided parameters.
Parameters
Name | Type | Description |
---|---|---|
toolbox | string | The name of the toolbox containing the tool |
toolName | string | The name of the tool to execute |
params | object | Parameters to pass to the tool execution (must match tool's input schema) |
Simple Example
// Read a file using filesystem toolbox
const fsResult = await codebolt.tools.executeTool('filesystem', 'read_file', {
path: './index.js'
});
console.log('✅ Tool execution result:', JSON.stringify(fsResult, null, 2));
// Different tools require different parameters
// Filesystem tools
await codebolt.tools.executeTool('filesystem', 'read_file', {
path: './file.txt'
});
await codebolt.tools.executeTool('filesystem', 'write_file', {
path: './output.txt',
content: 'Hello World'
});
// SQLite tools
await codebolt.tools.executeTool('sqlite', 'list_tables', {
random_string: 'test'
});
await codebolt.tools.executeTool('sqlite', 'read_query', {
query: 'SELECT * FROM users LIMIT 5'
});