# afterTool

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

Callback executed after a tool finishes its execution.

This callback allows for inspecting, logging, or modifying the result returned by a tool before it is returned to the agent.

#### Return

The potentially modified result 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.