Class: BaseTool<TParameters, TResult>
Base abstract class for tools with type parameter support Provides type-safe parameter handling and result processing
Type parameters
| Name | Type | Description |
|---|---|---|
TParameters | BaseToolParameters | Tool parameters type (defaults to BaseToolParameters for backward compatibility) |
TResult | ToolResult | Tool result type (defaults to ToolResult for backward compatibility) |
Hierarchy
BaseTool
Implements
TypeSafeToolInterface<TParameters,TResult>
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new BaseTool<TParameters, TResult>(): BaseTool<TParameters, TResult>
Type parameters
| Name | Type |
|---|---|
TParameters | BaseToolParameters |
TResult | ToolResult |
Returns
BaseTool<TParameters, TResult>
Properties
schema
• Readonly Abstract schema: ToolSchema
Implementation of
Defined in
packages/agents/src/abstracts/base-tool.ts:74
Methods
execute
▸ execute(parameters, context?): Promise<TResult>
Parameters
| Name | Type |
|---|---|
parameters | TParameters |
context? | ToolExecutionContext |
Returns
Promise<TResult>
Implementation of
Defined in
packages/agents/src/abstracts/base-tool.ts:76
validate
▸ validate(parameters): boolean
Parameters
| Name | Type |
|---|---|
parameters | TParameters |
Returns
boolean
Implementation of
TypeSafeToolInterface.validate
Defined in
packages/agents/src/abstracts/base-tool.ts:78
validateParameters
▸ validateParameters(parameters): ParameterValidationResult
Validate tool parameters with detailed result (default implementation)
Parameters
| Name | Type |
|---|---|
parameters | TParameters |
Returns
Implementation of
TypeSafeToolInterface.validateParameters
Defined in
packages/agents/src/abstracts/base-tool.ts:86
getDescription
▸ getDescription(): string
Returns
string
Implementation of
TypeSafeToolInterface.getDescription
Defined in
packages/agents/src/abstracts/base-tool.ts:103
getName
▸ getName(): string
Returns
string