Overview
Theontoolinput notification handler is called when the host sends complete tool arguments. This event arrives after a tool call begins and before the tool result is available, giving your app a window to process or display the finalized input.
Like all notification handlers, ontoolinput should be registered before calling connect() to ensure no events are missed during the initialization handshake.
Signature
Parameters
Complete tool call arguments as key-value pairs.
Usage
Basic usage
Rendering tool input in the UI
Using with the sunpeak framework
The sunpeak framework provides theuseToolData hook, which wraps ontoolinput (along with related handlers) into a reactive value for React components. This is the recommended approach when building with sunpeak.
Related
- Event Handlers overview — all notification and request handlers
- ontoolinputpartial — stream partial arguments as they arrive
- ontoolresult — handle the tool execution result