Skip to main content

executeTool

codebolt.mcp.executeTool(toolName: string, params: any, mcpServer: string (optional)): Promise<any>
Executes a specified tool with the provided parameters.

Parameters

NameTypeDescription
toolNamestringThe name of the tool to execute.
paramsanyParameters required for executing the tool.
mcpServerstring (optional)The MCP server to use for execution.

Returns:

 Promise<any>
A promise that resolves with the tool execution result.

Example

// Example: Executing a tool
const result = await codebolt.mcp.executeTool("imageProcessor", { imageUrl: "https://example.com/image.jpg" });
console.log("Tool Execution Result:", result);