Skip to main content
Glama

DOM snapshot

dom_snapshot
Read-onlyIdempotent

Get the rendered HTML of a page or a CSS-selected subtree to inspect the exact DOM state, providing precise page content for agents instead of screenshots.

Instructions

Return the rendered HTML of a target — the whole document, or just the subtree of the first element matching a CSS selector. This is the DOM the agent should read instead of a screenshot: it carries far more information and is exact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNoCSS selector to scope the snapshot to (omit for the full document).
target_idYesTarget id from list_targets — the page / webview / Electron window to inspect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=true. The description adds that it returns rendered HTML (not just raw DOM) and that it is exact, which is useful context beyond the annotations. No contradiction.

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 description is two sentences, front-loads the core purpose, and provides a clear rationale for using it over screenshots. Slightly verbose in the second sentence but efficiently sized for the tool's importance.

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?

Given the tool is simple (2 params, no output schema, no nested objects), the description is complete enough: it explains the scope via selector, the target via target_id, and the behavioral advantage over screenshots. The exact return format is not specified, but for a read-only snapshot tool this is not a major 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 both parameters are already well-documented (selector and target_id with descriptions). The description adds the semantic meaning of selector as scoping the snapshot, but the schema already states that. No additional semantics beyond the schema, so baseline 3 is appropriate.

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 returns rendered HTML for a target, with options for the whole document or a subtree via CSS selector. It distinguishes itself from screenshot and query_dom by explicitly positioning this as the exact, information-rich alternative to screenshots.

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?

It tells when to use the tool (when the agent needs to read the DOM rather than a screenshot) and contrasts with screenshots, but does not explicitly mention when not to use it or alternatives like query_dom for specific queries. Still, the context of preferring it over screenshots is clear.

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