Skip to main content
Glama

dom.inspect

Read-only

Retrieve attributes, computed box, visibility, stable selector path, and markup for one DOM element using a CSS selector, XPath, snapshot ref, or node ID.

Instructions

Everything about one element: attributes, computed box, visibility, a stable selector path and its markup.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "dom.inspect"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNoZero-based index when the locator matches several elements.
refNoSnapshot ref (eNN) from page.snapshot.
textNoVisible text of the element.
xpathNoXPath expression.
frame_idNoFrame to search within; see page.list_frames.
selectorNoCSS selector; pierces shadow DOM.
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered by structured data. The description contributes the return payload, which matters because there is no output schema, but it omits behavior the agent would want: what happens when a locator matches multiple elements, whether a missing element errors or returns empty, and whether it can auto-launch a browser.

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?

A single dense sentence, front-loaded with the scope ('one element') followed by the returned fields, with no filler. It is slightly clipped as a sentence fragment, but every clause carries information.

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

Completeness3/5

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

With nine optional parameters, no output schema and no required fields, the description does useful work by enumerating return contents. However, it leaves the agent without guidance on which locator parameter to supply, how ambiguity is resolved, or what failure looks like, which is a real gap for a tool with this many mutually alternative inputs.

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% across all nine parameters, so each locator strategy (ref, selector, xpath, text, backend_node_id) and the nth disambiguator are already documented. The description adds only the notion that resolution targets a single element, which mildly reinforces nth but gives no guidance on combining or prioritizing locator types.

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

Purpose4/5

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

The description names a specific resource (one element) and enumerates the payload it returns: attributes, computed box, visibility, selector path, markup. That makes it distinguishable from sibling readers like dom.get_html or dom.query, though the phrasing is noun-phrase only rather than a verb+resource statement and it never names those siblings explicitly.

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

Usage Guidelines2/5

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

There is no when-to-use guidance at all: no mention of when to prefer this over dom.query, dom.get_html, dom.summary, or debugger.inspect_object, and no statement of prerequisites such as needing a snapshot ref or a target handle. The agent must infer the tool's role from the payload list alone.

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

Deploy Server

Other Tools