Skip to main content

CodeboltTools API

Codebolt Tools API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
executeExecutes a CodeBolt tool with the provided input.
getConfigRetrieves the current tools configuration.
getOpenAiFunctionRetrieves a specific tool formatted as an OpenAI function.
getOpenAiFunctionsRetrieves all tools formatted as OpenAI functions.
getOpenAiToolRetrieves a specific tool formatted as an OpenAI tool.
getOpenAiToolsRetrieves all tools formatted as OpenAI tools.
getSchemaRetrieves the JSON schema for a specific tool.
listLists all available CodeBolt tools.
updateConfigUpdates the tools configuration.
validateValidates tool input before execution.

Methods


execute

client.codeboltTools.execute(data: ExecuteToolRequest): Promise<unknown>

Executes a CodeBolt tool with the provided input.

Runs the specified tool with the given parameters and returns the execution result. Tool execution may involve file operations, API calls, or other platform-specific actions.

ParameterTypeRequiredDescription
dataExecuteToolRequestYesRequest containing tool execution details

Returns: Promise<unknown> — A promise that resolves to the tool execution result

Full reference →


getConfig

client.codeboltTools.getConfig(): Promise<CodeboltToolsConfig>

Retrieves the current tools configuration.

Returns system-wide settings that control tool behavior, availability, permissions, and other configuration options. Useful for understanding the current tool setup.

No parameters.

Returns: Promise<CodeboltToolsConfig> — A promise that resolves to the CodeboltToolsConfig object

Full reference →


getOpenAiFunction

client.codeboltTools.getOpenAiFunction(toolName: string): Promise<OpenAiFunction>

Retrieves a specific tool formatted as an OpenAI function.

Returns a single tool in OpenAI's functions schema format for targeted integration with the legacy function calling API.

ParameterTypeRequiredDescription
toolNamestringYesThe name of the tool to retrieve

Returns: Promise<OpenAiFunction> — A promise that resolves to the OpenAiFunction object

Full reference →


getOpenAiFunctions

client.codeboltTools.getOpenAiFunctions(): Promise<OpenAiFunction[]>

Retrieves all tools formatted as OpenAI functions.

Returns the entire tool catalog in OpenAI's functions schema format, compatible with the legacy function calling API. Each function includes its name, description, and parameter schema.

No parameters.

Returns: Promise<OpenAiFunction[]> — A promise that resolves to an array of OpenAiFunction objects

Full reference →


getOpenAiTool

client.codeboltTools.getOpenAiTool(toolName: string): Promise<OpenAiTool>

Retrieves a specific tool formatted as an OpenAI tool.

Returns a single tool in OpenAI's tools schema format for targeted integration when only specific tools are needed for function calling.

ParameterTypeRequiredDescription
toolNamestringYesThe name of the tool to retrieve

Returns: Promise<OpenAiTool> — A promise that resolves to the OpenAiTool object

Full reference →


getOpenAiTools

client.codeboltTools.getOpenAiTools(): Promise<OpenAiTool[]>

Retrieves all tools formatted as OpenAI tools.

Returns the entire tool catalog in OpenAI's tools schema format, suitable for direct use with OpenAI's API function calling feature. Each tool includes its type, function definition, and parameters.

No parameters.

Returns: Promise<OpenAiTool[]> — A promise that resolves to an array of OpenAiTool objects

Full reference →


getSchema

client.codeboltTools.getSchema(toolName: string): Promise<CodeboltToolSchema>

Retrieves the JSON schema for a specific tool.

Returns the schema definition that describes the tool's input structure, required parameters, and validation rules. Useful for building dynamic UI forms or validating tool inputs before execution.

ParameterTypeRequiredDescription
toolNamestringYesThe name of the tool to get schema for

Returns: Promise<CodeboltToolSchema> — A promise that resolves to the CodeboltToolSchema object

Full reference →


list

client.codeboltTools.list(params?: Record<string, unknown>): Promise<CodeboltTool[]>

Lists all available CodeBolt tools.

Returns every registered tool in the system regardless of category or permission. Use this for comprehensive tool discovery or to populate tool selection interfaces.

ParameterTypeRequiredDescription
paramsRecord<string, unknown>NoOptional query parameters for filtering tools

Returns: Promise<CodeboltTool[]> — A promise that resolves to an array of CodeboltTool objects

Full reference →


updateConfig

client.codeboltTools.updateConfig(data: UpdateCodeboltToolsConfigRequest): Promise<CodeboltToolsConfig>

Updates the tools configuration.

Modifies system-wide tool settings including enabled/disabled tools, permissions, rate limits, and other configuration options. Changes take effect immediately.

ParameterTypeRequiredDescription
dataUpdateCodeboltToolsConfigRequestYesRequest containing configuration updates

Returns: Promise<CodeboltToolsConfig> — A promise that resolves to the updated CodeboltToolsConfig object

Full reference →


validate

client.codeboltTools.validate(data: ValidateToolRequest): Promise<unknown>

Validates tool input before execution.

Checks whether the provided parameters conform to the tool's schema requirements. Returns validation results highlighting any errors or warnings without actually executing the tool.

ParameterTypeRequiredDescription
dataValidateToolRequestYesRequest containing validation data

Returns: Promise<unknown> — A promise that resolves to validation results

Full reference →