Tools
Read tool arguments, execution status, and result state inside assistant-ui tool UI components.
API Reference
useToolArgsStatus
Reads whether each argument field for the current tool-call message part is still streaming or complete.
Use inside a tool-call renderer to avoid showing incomplete argument values as final.
function WeatherToolUI({
args,
}: ToolCallMessagePartProps<{ city: string }>) {
const { propStatus } = useToolArgsStatus<{ city: string }>();
return (
<span>
{propStatus.city === "streaming" ? "Reading city..." : args.city}
</span>
);
}const useToolArgsStatus: <TArgs extends Record<string, unknown> = Record<string, unknown>>() => ToolArgsStatus<TArgs>;