agents / Exports / ProgressReportingTool
Interface: ProgressReportingTool
🆕 ProgressReportingTool - Optional interface for tools that can provide their own progress information
This interface extends the standard ToolInterface to allow tools to optionally provide:
- Estimated execution duration
- Step-by-step execution plans
- Real-time progress callbacks
Benefits:
- Tools can provide accurate progress information based on their internal knowledge
- No simulation or fake progress - only real tool-provided estimates
- Completely optional - existing tools work unchanged
- Tools can self-report progress for better user experience
Hierarchy
↳
ProgressReportingTool
Table of contents
Properties
Methods
- getEstimatedDuration
- getExecutionSteps
- setProgressCallback
- execute
- validate
- validateParameters
- getDescription
Properties
schema
• schema: ToolSchema
Tool schema
Inherited from
Defined in
packages/agents/src/interfaces/tool.ts:190
Methods
getEstimatedDuration
▸ getEstimatedDuration(parameters): number
Get estimated execution duration for given parameters (optional)
Tools can implement this to provide accurate time estimates based on:
- Parameter complexity (e.g., search query length, file size)
- Historical execution data
- Internal optimization knowledge
Parameters
| Name | Type | Description |
|---|---|---|
parameters | ToolParameters | The parameters that will be passed to execute() |
Returns
number
Estimated duration in milliseconds, or undefined if not available
Defined in
packages/agents/src/interfaces/progress-reporting.ts:51
getExecutionSteps
▸ getExecutionSteps(parameters): ToolExecutionStep[]
Get execution steps for given parameters (optional)
Tools can implement this to provide step-by-step execution plans:
- webSearch: [query processing, API call, result parsing, filtering]
- fileSearch: [file scanning, content reading, pattern matching, result formatting]
- github-mcp: [authentication, API request, response processing, data transformation]
Parameters
| Name | Type | Description |
|---|---|---|
parameters | ToolParameters | The parameters that will be passed to execute() |
Returns
Array of execution steps, or undefined if not available
Defined in
packages/agents/src/interfaces/progress-reporting.ts:64
setProgressCallback
▸ setProgressCallback(callback): void
Set progress callback for real-time updates (optional)
Tools can implement this to provide real-time progress updates during execution:
- Called when each step starts/completes
- Progress value between 0-100 representing completion percentage
- Step name helps users understand what's currently happening
Parameters
| Name | Type | Description |
|---|---|---|
callback | ToolProgressCallback | Function to call with progress updates |
Returns
void
Defined in
packages/agents/src/interfaces/progress-reporting.ts:76
execute
▸ execute(parameters, context?): Promise<ToolResult>
Execute the tool with given parameters
Parameters
| Name | Type |
|---|---|
parameters | ToolParameters |
context? | ToolExecutionContext |
Returns
Promise<ToolResult>
Inherited from
Defined in
packages/agents/src/interfaces/tool.ts:195
validate
▸ validate(parameters): boolean
Validate tool parameters
Parameters
| Name | Type |
|---|---|
parameters | ToolParameters |
Returns
boolean
Inherited from
Defined in
packages/agents/src/interfaces/tool.ts:200
validateParameters
▸ validateParameters(parameters): ParameterValidationResult
Validate tool parameters with detailed result
Parameters
| Name | Type |
|---|---|
parameters | ToolParameters |
Returns
Inherited from
ToolInterface.validateParameters
Defined in
packages/agents/src/interfaces/tool.ts:205
getDescription
▸ getDescription(): string
Get tool description
Returns
string