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

ToolCallPart.md

119 lines2.1 KB

1---
2id: ToolCallPart
3title: ToolCallPart
4---
5​
6# Interface: ToolCallPart\<TMetadata\>
7​
8Defined in: [packages/typescript/ai/src/types.ts:335](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L335)
9​
10## Type Parameters
11​
12### TMetadata
13​
14`TMetadata` = `unknown`
15​
16## Properties
17​
18### approval?
19​
20```ts
21optional approval: object;
22```
23​
24Defined in: [packages/typescript/ai/src/types.ts:342](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L342)
25​
26Approval metadata if tool requires user approval
27​
28#### approved?
29​
30```ts
31optional approved: boolean;
32```
33​
34#### id
35​
36```ts
37id: string;
38```
39​
40#### needsApproval
41​
42```ts
43needsApproval: boolean;
44```
45​
46***
47​
48### arguments
49​
50```ts
51arguments: string;
52```
53​
54Defined in: [packages/typescript/ai/src/types.ts:339](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L339)
55​
56***
57​
58### id
59​
60```ts
61id: string;
62```
63​
64Defined in: [packages/typescript/ai/src/types.ts:337](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L337)
65​
66***
67​
68### metadata?
69​
70```ts
71optional metadata: TMetadata;
72```
73​
74Defined in: [packages/typescript/ai/src/types.ts:351](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L351)
75​
76Provider-specific metadata that round-trips with the tool call.
77Typed per-adapter via `TToolCallMetadata`.
78​
79***
80​
81### name
82​
83```ts
84name: string;
85```
86​
87Defined in: [packages/typescript/ai/src/types.ts:338](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L338)
88​
89***
90​
91### output?
92​
93```ts
94optional output: any;
95```
96​
97Defined in: [packages/typescript/ai/src/types.ts:348](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L348)
98​
99Tool execution output (for client tools or after approval)
100​
101***
102​
103### state
104​
105```ts
106state: ToolCallState;
107```
108​
109Defined in: [packages/typescript/ai/src/types.ts:340](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L340)
110​
111***
112​
113### type
114​
115```ts
116type: "tool-call";
117```
118​
119Defined in: [packages/typescript/ai/src/types.ts:336](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L336)