ToolLifecycle class

Callbacks for tool-level lifecycle events.

Allows observation and modification of tool execution at each stage.

Constructors

ToolLifecycle({Future<void> onToolRegistered(ToolRegisteredEvent event)?, Future<Map<String, dynamic>?> onToolBeforeExecution(ToolBeforeExecutionEvent event)?, Future<String?> onToolAfterExecution(ToolAfterExecutionEvent event)?, Future<ToolRecoveryAction> onToolError(ToolErrorEvent event)?, Future<void> onToolTimeout(ToolTimeoutEvent event)?})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
onToolAfterExecution Future<String?> Function(ToolAfterExecutionEvent event)?
Fired after a tool executes successfully. Can return modified output.
final
onToolBeforeExecution Future<Map<String, dynamic>?> Function(ToolBeforeExecutionEvent event)?
Fired before a tool executes. Can return modified input.
final
onToolError Future<ToolRecoveryAction> Function(ToolErrorEvent event)?
Fired when a tool encounters an error. Can return a recovery action.
final
onToolRegistered Future<void> Function(ToolRegisteredEvent event)?
Fired when a new tool is registered with the tool registry.
final
onToolTimeout Future<void> Function(ToolTimeoutEvent event)?
Fired when a tool execution times out.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited