TanStack

ToolCallHookContext

Interface: ToolCallHookContext

Defined in: packages/ai/src/activities/chat/middleware/types.ts:377

Context provided to tool call hooks (onBeforeToolCall / onAfterToolCall).

Properties

args

ts
args: unknown;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:383

Parsed arguments for the tool call


tool

ts
tool: 
  | Tool<SchemaInput, SchemaInput, string, unknown>
  | undefined;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:381

The resolved tool definition, if found


toolCall

ts
toolCall: ToolCall;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:379

The tool call being executed


toolCallId

ts
toolCallId: string;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:387

ID of the tool call


toolName

ts
toolName: string;

Defined in: packages/ai/src/activities/chat/middleware/types.ts:385

Name of the tool