Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

ToolCallHookContext.md

71 lines1.7 KB

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

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

Properties

args

args: unknown;

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

Parsed arguments for the tool call, before the inputSchema check: no schema defaults or transforms yet, and possibly invalid.


tool

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

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

The resolved tool definition, if found


toolCall

toolCall: ToolCall;

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

The tool call being executed


toolCallId

toolCallId: string;

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

ID of the tool call


toolName

toolName: string;

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

Name of the tool