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

ToolCallHookContext.md

71 lines1.1 KB

1---
2id: ToolCallHookContext
3title: ToolCallHookContext
4---
5​
6Defined in: packages/ai/src/activities/chat/middleware/types.ts:430
7​
8Context provided to tool call hooks (onBeforeToolCall / onAfterToolCall).
9​
10## Properties
11​
12### args
13​
14```ts
15args: unknown;
16```
17​
18Defined in: packages/ai/src/activities/chat/middleware/types.ts:439
19​
20Parsed arguments for the tool call, before the `inputSchema` check: no
21schema defaults or transforms yet, and possibly invalid.
22​
23***
24​
25### tool
26​
27```ts
28tool:
29 | Tool<SchemaInput, SchemaInput, string, unknown>
30 | undefined;
31```
32​
33Defined in: packages/ai/src/activities/chat/middleware/types.ts:434
34​
35The resolved tool definition, if found
36​
37***
38​
39### toolCall
40​
41```ts
42toolCall: ToolCall;
43```
44​
45Defined in: packages/ai/src/activities/chat/middleware/types.ts:432
46​
47The tool call being executed
48​
49***
50​
51### toolCallId
52​
53```ts
54toolCallId: string;
55```
56​
57Defined in: packages/ai/src/activities/chat/middleware/types.ts:443
58​
59ID of the tool call
60​
61***
62​
63### toolName
64​
65```ts
66toolName: string;
67```
68​
69Defined in: packages/ai/src/activities/chat/middleware/types.ts:441
70​
71Name of the tool