Skip to main content

executeTool

codebolt.tool.executeTool(toolbox: string, toolName: string, params: object): Promise<undefined>
Executes a specific tool from a configured toolbox with provided parameters.

Parameters

NameTypeDescription
toolboxstringThe name of the toolbox containing the tool
toolNamestringThe name of the tool to execute
paramsobjectParameters 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'
});