Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
depthNoHow 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.
tabIdYesRequired: 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.
filterNo"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_idNoRead 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_charsNoUpper 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It thoroughly explains the walk limits (depth, element count, char trim), that handles are per-document and invalidate after navigation, and that alerts/confirms freeze the page. It even reports how limits are signaled via bracketed notes. This is exemplary transparency beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but every sentence adds unique value: purpose, filter usage, limits, handle invalidation, tabId requirements, and Firefox specifics are all covered. It is front-loaded with the core purpose and structured logically, with no filler or redundancy. The length is justified by the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description fully explains what the output looks like (indented accessibility tree with roles, names, boxes, ref handles, and limit notes). It covers all parameters, the scenarios for using them, and edge cases (stale handles, alert freezing). An agent can invoke the tool correctly with only this description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While schema coverage is 100%, the description adds substantial meaning to each parameter: depth is contextualized for cutting bulky pages, filter distinguishes interactive vs layout exploration, ref_id is presented as the fix for overflow, and max_chars is tied to client capacity. The rationale and usage guidance far exceed the schema's terse property descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Dump a loaded page as an indented accessibility tree') with clear resource and scope. It differentiates itself from siblings by explaining it provides ref_N handles for other element tools, and explicitly mentions the 'interactive' filter as a contrast to the full tree. This leaves no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use guidance: it is the source of ref_N handles for form_input and other element tools, and recommends the 'interactive' filter when only controls are needed. It also specifies tabId requirements, mentions browser_batch usage, and notes Firefox-specific behavior (alerts freeze the page). This covers both usage conditions and alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.