tool( )





Pattern
Tool Input Lifecycle Hooks
Explore tool input lifecycle hooks: onInputStart, onInputDelta, and onInputAvailable. See how to track tool input generation in real-time during streaming.
BeginnerNov 2025View the full pattern on desktop


Problems solved
- Track tool input generation in real-time
- Monitor tool input streaming with lifecycle hooks
- Understand tool input lifecycle events
- Debug tool input generation process
Use cases
- Learning tool input lifecycle hooks
- Debugging tool input generation
- Monitoring tool input streaming
- Understanding AI SDK tool APIs
AI SDK APIs
streamTextconvertToModelMessagestool(useChatonInputStartonInputDeltaonInputAvailable
Tags
aitoolslifecycle-hooksonInputStartonInputDeltaonInputAvailablestreamingai-sdktool-api
Requirements
- Node.js
- 24+
- Memory
- 512MB
- Other
- OpenAI API key
Environment variables
OPENAI_API_KEYGet key
External services
openai
Ready to use?
View the full interactive pattern with live preview and copy the source code.
View the pattern on desktopRelated patterns


Preliminary Tool Results
Return preliminary tool results using async iterables. Stream status updates during tool execution before the final result is available.
aitools+6
View pattern →


Tool API Context
Pass arbitrary context from generateText/streamText to tool execution via experimental_context. Access context in tool execute functions for dynamic behavior.
aitools+5
View pattern →
You’ve reached the end of this pattern.



