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

ToolCallStartEvent.md

77 lines1.6 KB

1---
2id: ToolCallStartEvent
3title: ToolCallStartEvent
4---
5​
6# Interface: ToolCallStartEvent
7​
8Defined in: [packages/ai/src/types.ts:1180](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1180)
9​
10Emitted when a tool call starts.
11​
12@ag-ui/core provides: `toolCallId`, `toolCallName`, `parentMessageId?`
13TanStack AI adds: `model?`, `toolName` (deprecated alias), `index?`, `metadata?`
14​
15## Extends
16​
17- `ToolCallStartEvent`
18​
19## Indexable
20​
21```ts
22[k: string]: unknown
23```
24​
25## Properties
26​
27### index?
28​
29```ts
30optional index: number;
31```
32​
33Defined in: [packages/ai/src/types.ts:1189](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1189)
34​
35Index for parallel tool calls
36​
37***
38​
39### metadata?
40​
41```ts
42optional metadata: Record<string, unknown>;
43```
44​
45Defined in: [packages/ai/src/types.ts:1194](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1194)
46​
47Provider-specific metadata to carry into the ToolCall.
48Untyped at the event layer because events flow through a discriminated
49union that does not survive generics; adapters cast it to their typed
50`TToolCallMetadata` shape when emitting.
51​
52***
53​
54### model?
55​
56```ts
57optional model: string;
58```
59​
60Defined in: [packages/ai/src/types.ts:1182](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1182)
61​
62Model identifier for multi-model support
63​
64***
65​
66### ~~toolName~~
67​
68```ts
69toolName: string;
70```
71​
72Defined in: [packages/ai/src/types.ts:1187](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1187)
73​
74#### Deprecated
75​
76Use `toolCallName` instead (from @ag-ui/core spec).
77Kept for backward compatibility.