Overview
TheuseToolData hook provides reactive access to both the tool’s input arguments and output data (structured content). It replaces the need for separate input/output hooks. The output field contains the data from your MCP tool’s structuredContent response.
Import
Signature
Parameters
Fallback value when no input is available. Optional.
Fallback value when no output is available. Optional.
Returns
Returns aToolData<TInput, TOutput> object with the following fields:
The tool call arguments.
Streaming partial input during tool execution.
The structured content from the tool result.
Whether the tool result indicates an error.
Whether the tool is still executing.
Whether the tool call was cancelled by the host or user.
Optional reason for cancellation, or null if not cancelled.