Skip to main content

Interface: ToolCallSegment

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

One tool call through its whole lifecycle.

Extends​

Properties​

agentId?​

optional agentId?: string

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

Set in group chat.

Inherited from​

BaseSegment.agentId


agentName?​

optional agentName?: string

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

Inherited from​

BaseSegment.agentName


approvalId?​

optional approvalId?: string

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

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


avatarEmoji?​

optional avatarEmoji?: string

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

Inherited from​

BaseSegment.avatarEmoji


childSegments?​

optional childSegments?: StreamSegment[]

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

Segments of an agent the tool ran (a subagent, a pipeline).


display?​

optional display?: ToolCallDisplay

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

The display the tool declares, resolved for this call. Renderers pick a card by display.kind and fall back to a generic one without it.


error?​

optional error?: string

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


id​

id: string

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

Inherited from​

BaseSegment.id


interruptId?​

optional interruptId?: string

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

Baleybots interrupt id, set while status is awaiting_interrupt (mid-execute askHuman). Resume via ProcessOptions.interruptResponses.


interruptSpec?​

optional interruptSpec?: unknown

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

What the UI renders while awaiting_interrupt.


modelOutput?​

optional modelOutput?: unknown

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

What the result was sent to the model as, when that is not result itself: an AI SDK tool-result output carrying Anthropic tool references (reference-only, its words stashed beside them). Resent as it was.


name​

name: string

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


producer?​

optional producer?: object

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

The provider and model that made the call.

model​

model: string

provider​

provider: string


providerMetadata?​

optional providerMetadata?: Record<string, unknown>

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

The provider's metadata on the call (Anthropic: caller), resent with it when the turn is rebuilt — only to the same producer.


rawArgs?​

optional rawArgs?: string

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

The arguments' JSON text as streamed, unparsed.


result?​

optional result?: unknown

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


status​

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

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

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).


step?​

optional step?: number

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

The model step (0-based, within its turn) that produced this segment. History stamps it when the step finishes, so a turn is rebuilt for the next request one step at a time, in the order it was sent (see deriveAPIMessages). Absent on segments stored without it, which are rebuilt as one assistant message per turn.

Inherited from​

BaseSegment.step


streamingOutput?​

optional streamingOutput?: string

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

Output the tool streamed before its result.


timestamp​

timestamp: number

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

Epoch milliseconds.

Inherited from​

BaseSegment.timestamp


toolCallId​

toolCallId: string

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

Provider-assigned.


type​

type: "tool_call"

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