Skip to main content

ToolBuilder

@codebolt/codeboltjs


Interface: ToolBuilder<TParams, TResult>

Defined in: packages/codeboltjs/src/tools/types.ts:303

Interface for a tool builder that validates parameters and creates invocations

Type Parameters

Type Parameter
TParams extends object
TResult extends ToolFrameworkResult

Properties

PropertyTypeDescriptionDefined in
canUpdateOutputbooleanWhether the tool supports live (streaming) outputpackages/codeboltjs/src/tools/types.ts:332
descriptionstringDescription of what the tool doespackages/codeboltjs/src/tools/types.ts:314
displayNamestringThe user-friendly display name of the toolpackages/codeboltjs/src/tools/types.ts:311
explanationstringOne sentence explanation as to why this tool is being used, and how it contributes to the goal.packages/codeboltjs/src/tools/types.ts:317
genAISchemaFunctionDeclarationFunction declaration schema for Google GenAI (for backward compatibility)packages/codeboltjs/src/tools/types.ts:326
isOutputMarkdownbooleanWhether the tool's output should be rendered as markdownpackages/codeboltjs/src/tools/types.ts:329
kindKindThe kind of tool for categorization and permissionspackages/codeboltjs/src/tools/types.ts:320
namestringThe internal name of the tool (used for API calls)packages/codeboltjs/src/tools/types.ts:308
schemaOpenAIToolSchemaPrimary schema format (OpenAI tool schema)packages/codeboltjs/src/tools/types.ts:323

Methods

build()

build(params: TParams): ToolInvocation<TParams, TResult>;

Defined in: packages/codeboltjs/src/tools/types.ts:335

Validates raw parameters and builds a ready-to-execute invocation

Parameters

ParameterType
paramsTParams

Returns

ToolInvocation<TParams, TResult>


buildAndExecute()

buildAndExecute(
params: TParams,
signal: AbortSignal,
updateOutput?: (output: string) => void): Promise<TResult>;

Defined in: packages/codeboltjs/src/tools/types.ts:341

Builds and executes tool in one step

Parameters

ParameterType
paramsTParams
signalAbortSignal
updateOutput?(output: string) => void

Returns

Promise<TResult>


validateBuildAndExecute()

validateBuildAndExecute(params: TParams, abortSignal: AbortSignal): Promise<ToolFrameworkResult>;

Defined in: packages/codeboltjs/src/tools/types.ts:348

Validates, builds, and executes tool in one step. Never throws.

Parameters

ParameterType
paramsTParams
abortSignalAbortSignal

Returns

Promise<ToolFrameworkResult>


validateToolParams()

validateToolParams(params: TParams): string | null;

Defined in: packages/codeboltjs/src/tools/types.ts:338

Validates tool parameters

Parameters

ParameterType
paramsTParams

Returns

string | null