Skip to content

Interface: SubagentEndEvent

@providerprotocol/agents


@providerprotocol/agents / index / SubagentEndEvent

Defined in: src/execution/types.ts:616

Event emitted when a sub-agent completes execution.

Contains success/failure status, the result or error message, tool executions performed, and token usage statistics.

optional error: string

Defined in: src/execution/types.ts:624

Error message (if failed)


parentToolCallId: string

Defined in: src/execution/types.ts:579

The parent tool call ID that spawned this sub-agent

SubagentEventBase.parentToolCallId


optional result: string

Defined in: src/execution/types.ts:622

Sub-agent’s response text (if successful)


subagentId: string

Defined in: src/execution/types.ts:575

Unique ID of the sub-agent instance

SubagentEventBase.subagentId


subagentType: string

Defined in: src/execution/types.ts:577

Type/name of the sub-agent (e.g., ‘explorer’, ‘planner’)

SubagentEventBase.subagentType


success: boolean

Defined in: src/execution/types.ts:620

Whether the sub-agent completed successfully


timestamp: number

Defined in: src/execution/types.ts:626

End timestamp in milliseconds since epoch


optional toolExecutions: object[]

Defined in: src/execution/types.ts:628

Tools used by the sub-agent during execution

arguments: Record<string, unknown>

result: string

toolName: string


type: "subagent_end"

Defined in: src/execution/types.ts:618

Event type discriminator


optional usage: TokenUsage

Defined in: src/execution/types.ts:634

Token usage for this sub-agent run