Open History to see the last commit
1---
2id: ApprovalRequestedEvent
3title: ApprovalRequestedEvent
4---
5
6# Interface: ApprovalRequestedEvent
7
8Defined in: [packages/ai/src/types.ts:1387](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1387)
9
10Emitted when a server tool requires approval before execution. The agent
11loop yields this and pauses — `structured-output.complete` will not fire
12for that run. The shape is fixed by the orchestrator's tool-approval flow
13(the agent-loop branch of `runStreamingStructuredOutputImpl` in
14`activities/chat/index.ts` forwards CUSTOM events from `TextEngine.run()`).
15
16## Extends
17
18- [`CustomEvent`](CustomEvent.md)
19
20## Indexable
21
22```ts
23[k: string]: unknown
24```
25
26## Properties
27
28### model?
29
30```ts
31optional model: string;
32```
33
34Defined in: [packages/ai/src/types.ts:1339](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1339)
35
36Model identifier for multi-model support
37
38#### Inherited from
39
40[`CustomEvent`](CustomEvent.md).[`model`](CustomEvent.md#model)
41
42***
43
44### name
45
46```ts
47name: "approval-requested";
48```
49
50Defined in: [packages/ai/src/types.ts:1388](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1388)
51
52#### Overrides
53
54```ts
55CustomEvent.name
56```
57
58***
59
60### value
61
62```ts
63value: object;
64```
65
66Defined in: [packages/ai/src/types.ts:1389](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1389)
67
68#### approval
69
70```ts
71approval: object;
72```
73
74##### approval.id
75
76```ts
77id: string;
78```
79
80##### approval.needsApproval
81
82```ts
83needsApproval: true;
84```
85
86#### input
87
88```ts
89input: unknown;
90```
91
92#### toolCallId
93
94```ts
95toolCallId: string;
96```
97
98#### toolName
99
100```ts
101toolName: string;
102```
103
104#### Overrides
105
106```ts
107CustomEvent.value
108```