Overview
TheuseWidgetAPI hook provides access to the widget runtime API, which includes methods for calling tools, sending messages, and controlling the widget display.
Import
Signature
Returns
The API object with methods, ornull if not available.
API Methods
The returned API object includes:callTool(name, args)- Invoke an MCP toolsendFollowUpMessage({ prompt })- Send a follow-up message to the chatopenExternal({ href })- Open an external URLrequestDisplayMode({ mode })- Request a display mode changerequestModal({ mode, params })- Request modal viewnotifyIntrinsicHeight(height)- Notify the platform of content height