Open History to see the last commit
1---
2id: ToolCallHookContext
3title: ToolCallHookContext
4---
5
6# Interface: ToolCallHookContext
7
8Defined in: [packages/typescript/ai/src/activities/chat/middleware/types.ts:163](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/middleware/types.ts#L163)
9
10Context provided to tool call hooks (onBeforeToolCall / onAfterToolCall).
11
12## Properties
13
14### args
15
16```ts
17args: unknown;
18```
19
20Defined in: [packages/typescript/ai/src/activities/chat/middleware/types.ts:169](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/middleware/types.ts#L169)
21
22Parsed arguments for the tool call
23
24***
25
26### tool
27
28```ts
29tool:
30 | Tool<SchemaInput, SchemaInput, string>
31 | undefined;
32```
33
34Defined in: [packages/typescript/ai/src/activities/chat/middleware/types.ts:167](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/middleware/types.ts#L167)
35
36The resolved tool definition, if found
37
38***
39
40### toolCall
41
42```ts
43toolCall: ToolCall;
44```
45
46Defined in: [packages/typescript/ai/src/activities/chat/middleware/types.ts:165](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/middleware/types.ts#L165)
47
48The tool call being executed
49
50***
51
52### toolCallId
53
54```ts
55toolCallId: string;
56```
57
58Defined in: [packages/typescript/ai/src/activities/chat/middleware/types.ts:173](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/middleware/types.ts#L173)
59
60ID of the tool call
61
62***
63
64### toolName
65
66```ts
67toolName: string;
68```
69
70Defined in: [packages/typescript/ai/src/activities/chat/middleware/types.ts:171](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/middleware/types.ts#L171)
71
72Name of the tool