Tools reference: views (operator UI)
The nine ui_ tools: show a form, a choice, a table or a live board, read your answer, notify you.
These nine tools are the Operator UI part. They let a session put a native view in front of you and read what you do with it. For the story behind them, read Views an agent puts in front of you. For the whole list of tools, see Cortex tools reference.
Who can call them. Every session Cortex starts (Claude Code, Codex, the Cortex Agent) while the Operator UI switch in Settings → MCP is on. A task run gets them too, on every surface. Minis in rooms do not. An applet shows its screens with cortex.ui instead, which is the same view format without the waiting. See Applet script calls.
Asking. These tools never ask you a question of their own. A view that asks is the question. With Agents use these tools without asking on, the agent's own program does not ask before a call either.
Where a view goes. Tools that show a view take surface: tab (a tab beside the session), overlay (a card over the session's tab, for a short blocking question) or stack (on the Stack). Only the surfaces switched on under Where views may appear are allowed. Without surface, a view goes to the first allowed one, a tab if it is allowed.
Try it
You don't call these tools yourself: you ask in your own words, in a session, and the agent picks the tools. Saying with Cortex or naming what you want to see (a view, a tab, the Stack) makes it reach for them.
| You type | What the agent uses |
|---|---|
| Draw the quarter sales evolution as a line chart using Cortex UI | ui_show with a chart view |
| Ask me which of these three suppliers to keep, with a short note for each | ui_ask with a choice |
| Show a live board of the migration, one row per table, and update it as you go | ui_show, then ui_update |
| Before you send the invoices, give me a form to check the amounts and dates | ui_ask with a form |
| Notify me when the import has finished | ui_notify |
Ask and show
ui_ask
Shows you a native view and waits for your answer. Use it for any question that needs more than a yes or no in the terminal: choices, forms, a table to pick rows from.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
view |
object | yes | The view: a CXUI document. The tool's description carries the grammar. ui_schema gives the full schema. |
surface |
string | no | tab, overlay or stack, among those allowed. |
id |
string | no | The id of a view shown earlier. The question is asked again on that view. |
timeout |
integer | no | Seconds to wait, at least 5. If it passes, the view stays open and the agent can call ui_wait on it. |
Returns. When you answer: outcome (submitted, cancelled or closed), action (the id of the button you pressed) and the values of every visible input. On a timeout, a note that the view is still open.
{
"view": {
"cxui": 1,
"title": "Which branch?",
"body": { "type": "vstack", "children": [
{ "type": "text", "id": "t", "text": "Deploy from which branch?" }
] },
"footer": { "type": "actions", "children": [
{ "type": "button", "id": "go", "title": "Deploy", "action": { "kind": "submit", "close": true } }
] }
},
"surface": "overlay"
}
ui_show
Shows a view without waiting and returns its id. Use it for a dashboard, a progress board or a table that grows. Keep it current with ui_update, pick up your clicks with ui_wait, and end with ui_close.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
view |
object | yes | The view, a CXUI document. |
surface |
string | no | tab, overlay or stack. |
id |
string | no | The id of a view shown earlier. The whole document of that view is replaced. |
Returns. The view's id.
ui_update
Changes an open view in place, addressed by node id. All the operations apply or none do. Focus, scroll and half-typed text survive.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id |
string | yes | The view's id. |
ops |
array of objects | yes | The operations, in order. |
The operations:
op |
Fields | What it does |
|---|---|---|
set |
id, props |
Merges properties into a node. |
replace |
id, node |
Replaces a node. |
insert |
parent, index, nodes |
Inserts into a node's children, a table's rows, a list's items or a chart's points (with series: the series name). |
remove |
id |
Removes a node, a row or an item. |
values |
values, force |
Sets input values. Inputs you edited are kept unless force is set. |
errors |
errors |
Shows a message under inputs, by input id. |
status |
text, tone, busy |
The view's status line. A null text clears it. |
title |
title, subtitle, icon |
Changes the title bar. |
Returns. The values that were kept (kept). A view's updates share a budget of 20 per second per session.
ui_wait
Returns what happened on a view, or on all of the session's views, after a given sequence number. It returns at once if there are events, else at the first one or when the timeout passes.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id |
string | no | One view. Without it, every view of the session. |
after |
integer | no | The sequence number to read after. Pass the seq of the last result. |
timeout |
integer | no | Seconds to wait. |
Returns. The events, each with the visible values, and the new seq. The kinds are submitted, cancelled, action (an event button or a list row action), change (an input that notifies), prompt (a prompt button typed into the session) and closed.
ui_read
The current values of a view's visible inputs, whether it is open and its surface, without waiting.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id |
string | yes | The view's id. |
ui_close
Closes a view. A ui_ask still waiting on it returns closed.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
id |
string | yes | The view's id. |
ui_list
Lists this session's views: id, title, surface and whether it is open. It takes no parameters.
ui_schema
Returns the full JSON Schema of a view document, with every node kind and property. Read it when the grammar in ui_ask and ui_show is not enough. It takes no parameters. The same schema is also served as a resource at cortex://ui/schema, with examples under cortex://ui/examples/.
ui_notify
Posts a macOS notification. A click brings the session forward. It is for something done or failed while you look elsewhere, not for questions.
| Parameter | Type | Required | Meaning |
|---|---|---|---|
title |
string | yes | At most 120 characters. |
body |
string | no | At most 400 characters. |
Gate. Offered only while Sessions may post notifications is on in the Operator UI section of Settings → MCP. Your notification settings still apply.
Something wrong or missing? Tell us