ToolCall is the bridge between your UI and your server logic. When a user clicks a button or submits a form, ToolCall invokes a server tool with the arguments you specify — the same tools you define with @mcp.tool().
The renderer proxies the call through the Prefab SDK, so the tool executes server-side with full access to your backend.
Passing Arguments
Use{{ key }} interpolation in the arguments dict to pass client state to the tool. Form controls with a name automatically sync to state — Input(name="city") updates city on every keystroke, no SetState needed.
Type a city name, click the button, and the current input value flows into the location argument.
Combined with Client Actions
Pass a list to execute multiple actions from a single interaction. A common pattern: update UI state before making the server call, so the user sees immediate feedback.Combined Actions
SetState executes first (instant), then ToolCall fires the server request.
API Reference
Protocol Reference
ToolCall