Skip to content

AfterToolCallEvent

Defined in: src/hooks/events.ts:117

Event triggered after a tool execution completes. Fired after tool execution finishes, whether successful or failed. Uses reverse callback ordering for proper cleanup semantics.

new AfterToolCallEvent(data): AfterToolCallEvent;

Defined in: src/hooks/events.ts:135

ParameterType
data{ agent: AgentData; toolUse: { name: string; toolUseId: string; input: JSONValue; }; tool: Tool; result: ToolResultBlock; error?: Error; }
data.agentAgentData
data.toolUse{ name: string; toolUseId: string; input: JSONValue; }
data.toolUse.namestring
data.toolUse.toolUseIdstring
data.toolUse.inputJSONValue
data.toolTool
data.resultToolResultBlock
data.error?Error

AfterToolCallEvent

HookEvent.constructor

readonly type: "afterToolCallEvent";

Defined in: src/hooks/events.ts:118


readonly agent: AgentData;

Defined in: src/hooks/events.ts:119


readonly toolUse: {
name: string;
toolUseId: string;
input: JSONValue;
};

Defined in: src/hooks/events.ts:120

name: string;
toolUseId: string;
input: JSONValue;

readonly tool: Tool;

Defined in: src/hooks/events.ts:125


readonly result: ToolResultBlock;

Defined in: src/hooks/events.ts:126


readonly optional error: Error;

Defined in: src/hooks/events.ts:127


optional retry: boolean;

Defined in: src/hooks/events.ts:133

Optional flag that can be set by hook callbacks to request a retry of the tool call. When set to true, the agent will re-execute the tool.