ToolBuilder
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
| Property | Type | Description | Defined in |
|---|---|---|---|
canUpdateOutput | boolean | Whether the tool supports live (streaming) output | packages/codeboltjs/src/tools/types.ts:332 |
description | string | Description of what the tool does | packages/codeboltjs/src/tools/types.ts:314 |
displayName | string | The user-friendly display name of the tool | packages/codeboltjs/src/tools/types.ts:311 |
explanation | string | One sentence explanation as to why this tool is being used, and how it contributes to the goal. | packages/codeboltjs/src/tools/types.ts:317 |
genAISchema | FunctionDeclaration | Function declaration schema for Google GenAI (for backward compatibility) | packages/codeboltjs/src/tools/types.ts:326 |
isOutputMarkdown | boolean | Whether the tool's output should be rendered as markdown | packages/codeboltjs/src/tools/types.ts:329 |
kind | Kind | The kind of tool for categorization and permissions | packages/codeboltjs/src/tools/types.ts:320 |
name | string | The internal name of the tool (used for API calls) | packages/codeboltjs/src/tools/types.ts:308 |
schema | OpenAIToolSchema | Primary 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
| Parameter | Type |
|---|---|
params | TParams |
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
| Parameter | Type |
|---|---|
params | TParams |
signal | AbortSignal |
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
| Parameter | Type |
|---|---|
params | TParams |
abortSignal | AbortSignal |
Returns
Promise<ToolFrameworkResult>
validateToolParams()
validateToolParams(params: TParams): string | null;
Defined in: packages/codeboltjs/src/tools/types.ts:338
Validates tool parameters
Parameters
| Parameter | Type |
|---|---|
params | TParams |
Returns
string | null