read_page
Retrieve a page's accessibility tree as a structured list of elements with roles, names, and ref handles for targeted automation. Filter for interactive controls or dive into subtrees.
Instructions
Dump a loaded page as an indented accessibility tree: one line per element carrying its role, accessible name, state, its viewport box when it has one, and a ref_N handle, which is what computer, form_input and the other element tools take as a target. Everything is listed by default, including elements scrolled out of view or hidden by CSS; pass filter "interactive" to keep only the controls. The walk stops 15 DOM levels below the body unless depth raises it, gives up after 5000 elements, and the rendered text is trimmed to 50000 characters (max_chars) on a line break so that no handle is cut in half - whenever any of those three fires, a bracketed note at the end names the limit that hit, how much of the whole you got and how to reach the rest. Handles are minted per document: after a navigation or a reload the old ones stop resolving, so read the page again instead of reusing them. tabId is required (tabs_context_mcp or firefox_status lists the ids this session owns), and a step inside browser_batch has to carry it too. Firefox specifics: the browser runs in its own automation profile, so nothing asks you to approve a site, but an open alert or confirm freezes the page until firefox_dialog answers it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | How many DOM levels below the body the listing may descend, 15 when omitted. Anything further down is skipped and reported in a closing note - lower it to cut a bulky page down to its skeleton, raise it when the control you want sits deeper than the walk reached. | |
| tabId | Yes | Required: the session tab to walk. Ids come from tabs_context_mcp or firefox_status; a tab outside this session's group, or one already closed, is refused rather than guessed. State it explicitly on a browser_batch step. | |
| filter | No | "interactive" keeps only what a person can operate - links, buttons, form fields, and anything carrying a click handler, tabindex or an interactive ARIA role. The default, "all", lists every element plus the page's text runs, hidden and off-screen ones included, which is what you want when you are working out the layout rather than acting on it. | |
| ref_id | No | Read one subtree instead of the whole document: give a handle from an earlier read_page or find and you get that element together with all of its descendants. This is the usual fix when a full read overflowed - focus on the form, table or card you care about. A handle from before the last navigation is gone and comes back as an error. | |
| max_chars | No | Upper bound on the rendered output, 50000 characters when omitted. The cut falls on a line boundary and the trailing note reports how much of the total you got. Raise it when your client can swallow a big payload; otherwise prefer narrowing with depth or ref_id. |