on_click, on_change, or on_submit. You pass an action instance (or a list of them) to wire up the behavior.
Client Actions
Client actions mutate local state instantly — no server round-trip, no waiting. These are the building blocks for responsive UIs.MCP Actions
MCP actions communicate with the host application — they call tools, send messages, or update context. Each one triggers a round-trip through the Prefab SDK.| Action | Purpose |
|---|---|
| Call Tool | Call a server-side tool with optional arguments |
| Send Message | Send a message to the chat as if the user typed it |
| Update Context | Silently update what the model knows |
Form Controls and State
Every form control with aname prop automatically syncs its value to $state. When a user types in Input(name="city"), the renderer updates city on every keystroke — no SetState or on_change needed.
Input, Textarea, Select, Combobox, RadioGroup, Slider, Checkbox, Switch, Calendar, DatePicker, Tabs, and Pages. The name is the state key.
SetState is still useful when you want to set state from a button click, toggle visibility, or store a value that doesn’t come from a form control.
State Interpolation
Actions support{{ key }} templates to inject the current client state into arguments, messages, or URLs. This is how UI values flow into server calls and other actions.