Overview
TheuseToolData hook provides reactive access to both the tool’s input arguments and output data. It replaces the need for separate input/output hooks. The output field contains structuredContent when the result includes that property, including an explicit null. When the property is absent, it falls back to the result’s content blocks.
Wraps ontoolinput · ontoolresult · ontoolcancelled
MCP Apps SDK reference
Import
Signature
Parameters
Returns
Returns aToolData<TInput, TOutput> object with the following fields:
The tool result’s
structuredContent value when present, including explicit null. Falls back to content when structuredContent is absent.Usage
Stream a Preview Before Complete Input Arrives
MCP hosts may send zero or more partial input notifications before the complete tool arguments. ReadinputPartial for preview UI and input for the finalized value:
inputPartial can contain missing, truncated, or changing fields. Use it only for rendering a preview. Wait for input before saving data or starting an action. See ontoolinputpartial for the protocol event order and local testing steps.