MCP Apps SDKDocumentation Index
Fetch the complete documentation index at: https://sunpeak.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theontoolcancelled notification handler is called when tool execution is cancelled. Cancellation can occur for several reasons: the user manually stops the tool, a timeout is reached, or a host-side classifier intervenes.
Use this handler to clean up in-progress state, stop animations, and display appropriate feedback to the user.
Like all notification handlers, ontoolcancelled should be registered before calling connect().
Signature
Parameters
Optional reason for the cancellation. May describe the cause (e.g., user action, timeout, or classifier intervention).
Usage
Basic cancellation handling
Cleaning up in-progress state
Combining with the full tool lifecycle
Using with the sunpeak framework
The sunpeak framework provides theuseToolData hook, which manages the full tool lifecycle including cancellation as a reactive value.
Related
- Event Handlers overview — all notification and request handlers
- ontoolresult — handle successful or failed tool results