ui_get_page_state
ui_get_page_stateRetrieves the current page URL, title, visible interactive elements, alerts, overlays, and focused element so agents can inspect UI state before clicking or filling fields.
Instructions
Return the current page's URL, title, visible interactive elements and visible alert/status messages. Each element is {role, name, selector, state?}: pass selector unchanged to ui_click/ui_fill (at most 200 elements); state lists only non-default fields (disabled, checked, value, expanded, selected, pressed, required, invalid; a password's value is never returned). Custom widgets (combobox, listbox, option, switch, slider, contenteditable, summary...) are listed too. overlays ({role, name, selector, modal}, topmost first) names each open dialog and is absent when none is open; focused ({role, name, selector}) names the element holding focus and is absent when focus is on the page body. To read page text use ui_get_text.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "ui_get_page_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Which open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open. |