Skip to main content
Glama

Get page snapshot

get_page_snapshot
Read-only

Returns the page’s accessibility tree as YAML—roles, names, states, and iframe contents—with [ref=eN] handles to use as aria-ref selectors, so you can inspect and interact without guessing selectors.

Instructions

Return the page's accessibility tree as YAML: roles, accessible names, values and states, including iframe contents. Every element has a [ref=eN] handle; pass it to other tools as selector "aria-ref=eN". Use this before interacting with a page instead of guessing selectors. Refs from older snapshots may go stale.

Input Schema

NameRequiredDescriptionDefault
depthNoLimit tree depth
selectorNoOnly snapshot this element's subtree
maxLengthNoTruncate output beyond this many characters

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations: it discloses that iframe contents are included, defines the [ref=eN] handle contract, specifies the cross-tool selector syntax 'aria-ref=eN', and warns that refs from older snapshots may go stale. The staleness warning is a genuine behavioral hazard an agent must know before caching refs across calls.

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?

Four tight sentences, front-loaded with what is returned, then the handle contract, then the usage directive, then the failure mode. No filler and nothing repeated from the schema.

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?

There is no output schema, so the description carries the burden of describing the return value - and it does, naming the format (YAML), the content (roles/names/values/states/iframes) and the embedded ref handles. Combined with complete schema parameter docs and annotations covering the safety profile, an agent has everything needed to call this correctly.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real meaning by explaining that the selector parameter is fed the aria-ref values emitted by this same tool, linking the parameter to observable output. It says nothing about depth or maxLength truncation, leaving that entirely to the schema.

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?

Specific verb and resource ('Return the page's accessibility tree as YAML') plus the exact shape of what comes back: roles, accessible names, values, states, iframe contents. This clearly distinguishes it from observation siblings like take_screenshot or get_console_errors, which return entirely different artifacts.

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

Usage Guidelines4/5

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

'Use this before interacting with a page instead of guessing selectors' states the triggering condition and names the anti-pattern it replaces, which is strong routing guidance. It does not explicitly say when not to use it or contrast it with take_screenshot, so it falls just short of a full 5.

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