call

abstract suspend fun call(context: ToolContext, tool: BaseTool, args: Map<String, Any>): CallbackChoice<Map<String, Any>, Map<String, Any>>

Invoked before the tool is executed.

Return

A CallbackChoice representing the tool response/arguments. When CallbackChoice.Break is returned, the value will be used as the tool response and the framework will skip calling the actual tool. When CallbackChoice.Continue is returned, the value will be used as the arguments to be passed to the tool.

Parameters

context

The context of the current tool execution.

tool

The tool about to be executed.

args

The arguments to be passed to the tool.