Docs
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
CodeRabbit
Cloudflare
AG Grid
SerpAPI
Netlify
OpenRouter
Neon
WorkOS
Clerk
Electric
PowerSync
Sentry
Railway
Prisma
Strapi
Unkey
Class References
Function References
Interface References
Type Alias References
Variable References
Interface References

ToolCallPart

Interface: ToolCallPart<TMetadata>

Defined in: packages/ai/src/types.ts:370

Type Parameters

TMetadata

TMetadata = unknown

Properties

approval?

ts
optional approval: object;
optional approval: object;

Defined in: packages/ai/src/types.ts:386

Approval metadata if tool requires user approval

approved?

ts
optional approved: boolean;
optional approved: boolean;

id

ts
id: string;
id: string;

needsApproval

ts
needsApproval: boolean;
needsApproval: boolean;

arguments

ts
arguments: string;
arguments: string;

Defined in: packages/ai/src/types.ts:374


id

ts
id: string;
id: string;

Defined in: packages/ai/src/types.ts:372


input?

ts
optional input: unknown;
optional input: unknown;

Defined in: packages/ai/src/types.ts:383

Parsed tool input. Set from the parsed arguments once they are complete (state: 'input-complete' and later). undefined while the raw arguments string is still streaming, and may stay undefined for a call that terminates in an error state — the raw arguments string is always available as a fallback. Typed per-tool on the client ToolCallPart (see @tanstack/ai-client); unknown on this base type.


metadata?

ts
optional metadata: TMetadata;
optional metadata: TMetadata;

Defined in: packages/ai/src/types.ts:397

Provider-specific metadata that round-trips with the tool call. Typed per-adapter via TToolCallMetadata. May follow the ProviderExecutedToolMetadata convention to mark provider-executed server tools (e.g. Anthropic web_search).


name

ts
name: string;
name: string;

Defined in: packages/ai/src/types.ts:373


output?

ts
optional output: any;
optional output: any;

Defined in: packages/ai/src/types.ts:392

Tool execution output (for client tools or after approval)


state

ts
state: ToolCallState;
state: ToolCallState;

Defined in: packages/ai/src/types.ts:384


type

ts
type: "tool-call";
type: "tool-call";

Defined in: packages/ai/src/types.ts:371