Skip to main content

Interface: ToolCallSegment

Defined in: packages/core/src/stream-segments/types.ts:37

Tool call segment (covers full lifecycle)

Extends

Properties

agentId?

optional agentId?: string

Defined in: packages/core/src/stream-segments/types.ts:20

Agent that produced this segment (populated in group chat contexts)

Inherited from

BaseSegment.agentId


agentName?

optional agentName?: string

Defined in: packages/core/src/stream-segments/types.ts:22

Display name of the agent

Inherited from

BaseSegment.agentName


approvalId?

optional approvalId?: string

Defined in: packages/core/src/stream-segments/types.ts:64

AI SDK approval id, set while status is awaiting_approval. Pass this back in the resume call's approvalResponses entry.


args?

optional args?: unknown

Defined in: packages/core/src/stream-segments/types.ts:44

Parsed arguments passed to the tool


avatarEmoji?

optional avatarEmoji?: string

Defined in: packages/core/src/stream-segments/types.ts:24

Avatar emoji for display

Inherited from

BaseSegment.avatarEmoji


childSegments?

optional childSegments?: StreamSegment[]

Defined in: packages/core/src/stream-segments/types.ts:66

Child segments for recursive tool calls (spawn_agent, pipelines, etc.)


error?

optional error?: string

Defined in: packages/core/src/stream-segments/types.ts:52

Error message if the tool call failed


id

id: string

Defined in: packages/core/src/stream-segments/types.ts:16

Unique identifier for React keys

Inherited from

BaseSegment.id


name

name: string

Defined in: packages/core/src/stream-segments/types.ts:42

Tool function name (e.g. 'spawn_agent', 'search')


rawArgs?

optional rawArgs?: string

Defined in: packages/core/src/stream-segments/types.ts:46

Raw JSON arguments as streamed (unparsed)


result?

optional result?: unknown

Defined in: packages/core/src/stream-segments/types.ts:50

Return value from the tool execution


status

status: "running" | "completed" | "failed" | "awaiting_approval"

Defined in: packages/core/src/stream-segments/types.ts:59

Status for display. awaiting_approval means the tool is gated by requiresApproval and the loop is paused pending a user decision — the UI should render an approve/reject prompt and resume via ProcessOptions.approvalResponses (see approvalId).


streamingOutput?

optional streamingOutput?: string

Defined in: packages/core/src/stream-segments/types.ts:48

Live streamed output chunks before final result


timestamp

timestamp: number

Defined in: packages/core/src/stream-segments/types.ts:18

Timestamp for ordering

Inherited from

BaseSegment.timestamp


toolCallId

toolCallId: string

Defined in: packages/core/src/stream-segments/types.ts:40

Provider-assigned identifier for this tool call


type

type: "tool_call"

Defined in: packages/core/src/stream-segments/types.ts:38