Set Ui Value
set_ui_valueSet a live marimo UI widget's value by its variable name to trigger reactive re-execution, with shape validation and read-back verification.
Instructions
Set the value of a live marimo UI element, by its variable name.
The kernel global named by variable_name must resolve to a marimo UI
element (e.g. mo.ui.slider, mo.ui.dropdown, mo.ui.text). Its
value is replaced with value, triggering reactive re-execution the
same way a user interaction would.
Value shape is per widget and is NEVER coerced: a slider/text takes a
scalar, a dropdown takes its option key inside a one-element list (for
example ["beta"]), a multiselect takes the list of selected keys, a
range_slider takes a two-element list, a checkbox takes a bool. The
element's own declaration decides; a shape mismatch is refused before
anything is applied and the response carries the corrected payload in
did_you_mean.
This tool accepts NO source code: it exists for widget interaction only,
not for arbitrary code execution. The update is flushed on code-mode
context exit, the kernel then re-runs dependent cells, and the element's
value is read back before returning — status: ok with
verified: true means the element's own value was observed to move (or
was already equal), not merely that the update was queued. A value marimo
rejected is reported as an error, never as success.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | New value for the element, in the shape that element accepts. | |
| server_url | No | Server URL override. | |
| session_id | No | Session ID; omit only when the active-session binding holds for this call (see `list_active_notebooks`). | |
| variable_name | Yes | Name of the live kernel global holding the UI element. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||