Skip to main content
Glama

dom_snapshot

Retrieve structured layout data including bounding boxes, computed styles, paint order, colors to answer spatial questions like element positions or colors that view_page cannot answer.

Instructions

Structured layout data: bounding boxes, computed styles, paint order, colors; refs match view_page. Only for spatial questions view_page cannot answer (is A above B? what color?).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref for a subtree snapshot

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.10.5
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref (e.g. 'e42') to get subtree snapshot for"New value: +"Element ref for a subtree snapshot"
  2. First observedv2.7.0

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are present, so the description carries full responsibility. It discloses the kind of data returned and the scope of use, and the data-only framing implies a read-only operation. It doesn't explicitly state that no page mutation occurs or what happens when ref is omitted, but it is reasonably transparent for a snapshot-introspection tool.

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?

Two tightly packed sentences: the first lists the data categories and the cross-tool ref relationship; the second states the exclusive usage condition. No filler, no repetition, and key information is front-loaded.

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 one-parameter tool with no output schema, the description covers the nature of return data, the ref linkage to view_page, and the intended use case. A small gap is the unspecified default scope when ref is omitted, but the schema's 'subtree snapshot' partially addresses that. Overall, sufficient for correct invocation.

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?

The schema already documents the only parameter (ref) at 100% coverage, so baseline is 3. The description adds genuinely useful context by noting 'refs match view_page', telling the agent that refs are shared with the sibling tool and clarifying how to populate the parameter. This exceeds the schema alone.

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 clearly states the tool's resource and function: it provides structured layout data including bounding boxes, computed styles, paint order, and colors. It explicitly distinguishes itself from view_page by naming the exact spatial questions it answers, so an agent can differentiate it from siblings without inspecting schemas.

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?

It explicitly says the tool is 'only for spatial questions view_page cannot answer' and provides concrete examples ('is A above B? what color?'). This is a clear when-to-use instruction and also implies when to prefer view_page, leaving nothing to inference.

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