TOOL_CALL_END as the completion marker for UI spinners and progress bars.
How It Works
Quick Start
1
Subscribe to Tool Events
Listen for tool execution completion events:
2
UI Integration
Use tool events for progress indicators in your UI:
Tool Event Types
TOOL_CALL_START
Emitted when tool execution begins with parsed arguments:TOOL_CALL_END
The stream end marker - signals tool execution completion:TOOL_CALL_RESULT
Final tool output after execution:Event Flow Sequence
Key Marker:TOOL_CALL_END is the completion signal for UI consumers. Use this to:
- Hide loading spinners
- Show completion checkmarks
- Enable follow-up actions
- Update progress bars
Multiple Tool Handling
When agents use multiple tools simultaneously:Error Handling
Tools can fail during execution:UI Integration Patterns
React Component
Terminal Progress
Best Practices
Use TOOL_CALL_END as the completion signal
Use TOOL_CALL_END as the completion signal
Don’t rely on
TOOL_CALL_RESULT for completion detection. TOOL_CALL_END is the definitive marker:Handle tool ID mapping
Handle tool ID mapping
Track tool calls by their unique IDs, not just names:
Gracefully handle missing events
Gracefully handle missing events
Network issues may cause missed events. Implement timeouts:
Event Data Reference
TOOL_CALL_START Event
TOOL_CALL_END Event
TOOL_PROGRESS Event
TOOL_PROGRESS events carry incremental output emitted by a tool while it runs — before it returns a result. Tools call emit_tool_progress() to surface partial output without changing their signature.
STREAM_UNAVAILABLE Event
The agent or model adapter emitsSTREAM_UNAVAILABLE when token streaming cannot run in the current configuration — for example when a provider falls back to a non-streaming response instead of failing silently. Treat it as an observable fallback signal for UIs and loggers.
Related
Agent Streaming
Core streaming concepts
Tool Progress Streaming
Stream incremental output from inside running tools
Tool Development
Creating custom tools

