Class: BaseTool<TParams, TResult>
Base tool abstract class
Abstract
BaseTool
Implements
Description
Provides base implementation for all tools. Common functionality is implemented here, schema-related methods are implemented in subclasses.
Type parameters
Name | Type | Description |
---|---|---|
TParams | any | Tool parameter type |
TResult | any | Tool result type |
Hierarchy
Implements
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new BaseTool<TParams
, TResult
>(options
): BaseTool
<TParams
, TResult
>
Constructor
Type parameters
Name | Type |
---|---|
TParams | any |
TResult | any |
Parameters
Name | Type | Description |
---|---|---|
options | BaseToolOptions <TParams , TResult > | Base tool options |
Returns
BaseTool
<TParams
, TResult
>
Defined in
packages/tools/src/tool/base-tool.ts:71
Properties
name
• Readonly
name: string
Tool name
Implementation of
Defined in
packages/tools/src/tool/base-tool.ts:29
description
• Readonly
description: string
Tool description
Implementation of
Defined in
packages/tools/src/tool/base-tool.ts:34
category
• Optional
Readonly
category: string
Tool category
Defined in
packages/tools/src/tool/base-tool.ts:39
version
• Optional
Readonly
version: string
Tool version
Defined in
packages/tools/src/tool/base-tool.ts:44
Accessors
schema
• get
schema(): any
Tool schema (implemented by subclasses)
Returns
any
Implementation of
Defined in
packages/tools/src/tool/base-tool.ts:85
Methods
execute
▸ execute(params
): Promise
<ToolResult
<TResult
>>
Execute tool
Parameters
Name | Type | Description |
---|---|---|
params | TParams | Tool parameters |
Returns
Promise
<ToolResult
<TResult
>>
Tool execution result
Implementation of
Defined in
packages/tools/src/tool/base-tool.ts:108
toFunctionSchema
▸ toFunctionSchema(): FunctionSchema
Convert to function schema
Returns
Function schema
Defined in
packages/tools/src/tool/base-tool.ts:145
toFunctionDefinition
▸ toFunctionDefinition(): FunctionDefinition
Convert to function definition
Returns
Function definition
Implementation of
ToolInterface.toFunctionDefinition
Defined in
packages/tools/src/tool/base-tool.ts:158
toString
▸ toString(): string
Generate string representation
Returns
string
String representation of the tool