call
abstract suspend fun call(context: ToolContext, tool: BaseTool, args: Map<String, Any>, error: Throwable): CallbackChoice<Unit, Map<String, Any>>
Callback executed when a tool call encounters an error.
Provides an opportunity to handle tool errors gracefully, potentially providing alternative responses or recovery mechanisms.
Return
A CallbackChoice where returning CallbackChoice.Break with a custom map intercepts the error and resolves execution using that fallback value. Returning CallbackChoice.Continue with Unit permits the error to be propagated naturally.
Parameters
context
The context of the current tool execution.
tool
The tool instance that encountered an error.
args
The arguments that were passed to the tool.
error
The exception that was raised.