call

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

Callback executed after a tool has been called.

This callback allows for inspecting, logging, or modifying the result returned by a tool.

Return

The potentially updated or replaced dictionary / map to propagate downstream.

Parameters

context

The context specific to the tool execution.

tool

The tool instance that has just been executed.

args

The original arguments that were passed to the tool.

result

The dictionary / map returned by the tool invocation.