Use Widget (WebMCP)
Mount a WebMCP widget by URL in the widget panel (right side of chat), discover the
tools it exposes, and invoke them. The widget runs client-side in the browser and
exposes its tools via document.modelContext; Tarsk talks to it over postMessage.
Widgets appear in a resizable panel to the right of the chat (similar to dual chat). The chat stream shows a compact "opened widget" row; the iframe renders in the panel.
When to use
Use this when a prompt or the user references a widget URL and a task to perform with it, such as:
Use widget at https://tarsk-webmcp-weather.netlify.app/ to display the weather for a zip code specified by the user.
Tools
open_widget({ url, title? })— Mounts the widget and returns the list of tools it exposes (each withname,description, andinputSchema). Always call this first.call_widget_tool({ url, tool, input })— Invokes one of the discovered tools. Theurlmust match the one passed toopen_widget;toolis a toolnamefrom the discovery result;inputmust satisfy that tool'sinputSchema.
Workflow
- Call
open_widgetwith the URL. Read the returned tool list to learn what is available and what inputs each tool needs. - Gather any required arguments from the user (for example, ask for a zip code if one was not provided).
- Call
call_widget_toolwith the chosen tool and arguments. The widget renders the result inline, and the tool result text is returned to you.
Worked example: weather by zip code
open_widget({ url: "https://mcp.tarsk.io/weather/" })- Returns a tool like:
get-weather— "Get current weather for a US zip code",inputSchema: { type: "object", properties: { zipcode: { type: "string" } }, required: ["zipcode"] }
- Returns a tool like:
- If the user gave a zip code (e.g.
94107), call it. Otherwise ask for one. call_widget_tool({ url: "https://tarsk-webmcp-weather.netlify.app/", tool: "get-weather", input: { zipcode: "94107" } })- The widget displays the weather in the widget panel and returns the result text.
Notes
- Use the exact tool
namestrings returned byopen_widget; do not invent tools. - Pass the same
urlto both tools socall_widget_toolreaches the mounted widget. - Only
httpswidget URLs are supported. The widget must implement the WebMCPpostMessagebridge (getTools/callTool).