Close a dialog that is hiding the page (verified)
dismiss_dialogCloses one consent or promo dialog covering the page: sends a single Escape to the dialog ref, verifies it closed, then falls back to a dismiss control inside it.
Instructions
Close ONE dialog that is covering the page. A consent or promo overlay can hide the entire page from the accessibility tree, so read_page shows almost nothing while the site renders normally. TRY dialog_ref FIRST for cookie, sale and promotional overlays: pass the ref of the DIALOG ITSELF (a row marked DIALOG-ROOT) and it sends ONE Escape, then verifies whether that exact dialog actually closed. Some overlays respond to Escape and some ignore it — the result tells you which, and never assumes. Worth trying first because a consent banner may expose NO close button at all, only Accept/Reject/Preferences. FALL BACK in a SEPARATE CALL to control_ref when Escape is unavailable or fails verification: pass a close/dismiss control INSIDE the dialog and its own action is invoked. If dialog_ref or dialog_text is supplied, the Escape path always wins even when control_ref is also present; this prevents callers from accidentally skipping the safe first attempt. Either way this tool ONLY closes. It refuses any control that makes a substantive choice (Accept, Reject, Preferences, Subscribe and similar), because those decide something on the user's behalf — use click_element if such a choice is genuinely intended. At most one action or one keypress, never a coordinate click, never a change of keyboard focus, and the outcome is verified from a fresh read. If another dialog remains it is reported with its ref rather than closed automatically.
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": "dismiss_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dialog_ref | No | PREFERRED for cookie, sale and promotional overlays: ref of the DIALOG ITSELF (a row marked DIALOG-ROOT in read_page). Sends ONE Escape and verifies whether that exact dialog actually closed. Worth trying first: a consent banner may expose no close button at all, only Accept/Reject/Preferences. Some overlays respond to Escape and some ignore it — the result tells you which. | |
| control_ref | No | FALLBACK: ref of a close/dismiss control INSIDE the dialog. Use when Escape is unavailable or fails verification. Activates that control's own action. May be combined with dialog_ref/dialog_text; the dialog identity still selects the Escape-first path; use control_ref alone on the separate fallback call. | |
| dialog_text | No | For a dynamic dialog, pass this with dialog_ref as a stale-identity fallback, or alone when no ref survives. The exact ref is tried first; text refresh occurs only after a stale-identity refusal and must resolve exactly one dialog. | |
| window_address | No | Hyprland window address; defaults to the active window. |