Skip to main content
Glama

get_dom_snapshot

Capture a structured DOM snapshot with element references to find selectors before clicking, typing, or hovering. Pass refs like e5 directly to interaction tools.

Instructions

Get a structured DOM snapshot with element references (e.g., e1, e2, e3). When to use: BEFORE any interaction tool (click, type_text, etc.) to find the right selector or element ref. Returns elements with tag, text, attributes, and position data. Element refs like 'e5' can be passed directly to click, type_text, hover, and other tools. Related: read_page (quick text content), click/type_text/hover (use refs from this snapshot). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tab_idNoOptional. Tab id this read targets. Omit when the calling agent owns exactly one tab; required to disambiguate when the agent owns multiple. Single-tab agents and legacy popup/sidepanel/autopilot do not need to pass this.
maxElementsNoMaximum elements to include (default: 2000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the return shape (tag, text, attributes, position), the error code TAB_NOT_OWNED for cross-agent access, agent-scoped tab ownership, and the tab cap. It stops short of explicitly stating read-only semantics and the cap's relation to maxElements is ambiguous, keeping it out of 5 territory.

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

Conciseness4/5

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

The critical 'When to use' guidance is front-loaded and every clause carries information, but the trailing multi-agent/cap sentence is dense and introduces a number that conflicts with the schema default, mildly muddying an otherwise tight structure.

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

Completeness4/5

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

For a no-annotation, no-output-schema read tool, the description covers purpose, usage trigger, return shape, and multi-agent behavior, so an agent has what it needs. The unresolved cap-vs-maxElements discrepancy is the only material gap.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description restates the tab_id ownership rule ('pass tab_id only when this agent owns multiple tabs') which the schema already documents, and it never explains maxElements, instead referencing a differently-scaled 'cap (default 8, 1-64)' against a schema default of 2000, so it adds no clarifying value.

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?

States a specific verb and resource ('Get a structured DOM snapshot with element references') and immediately differentiates itself from siblings by naming read_page as the quick-text alternative. An agent can tell it apart from get_page_snapshot and get_text without opening any schema.

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?

Explicitly says 'BEFORE any interaction tool (click, type_text, etc.)' as the trigger condition, and the 'Related' line routes the agent to read_page for plain text and to click/type_text/hover as consumers of the refs. Both when-to-use and the alternative are stated, not implied.

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