Skip to main content
Glama

inspect_dom

Read-only

Retrieve a page's HTML, including open shadow roots and same-origin iframes, or search for case-sensitive text to return focused context instead of full markup.

Instructions

Returns the page's HTML (open shadow roots as , same-origin iframes appended after ; at most 100000 characters), or with 'query' the first match and its context. To find elements to act on, prefer 'snapshot'.

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": "inspect_dom"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNoCharacters after the match, at most 10000. Default: 200.
queryNoCase-sensitive text to find: returns its context instead of the whole HTML.
beforeNoCharacters before the match, at most 10000. Default: 200.
tab_idNoDefault: the active tab.
instance_idNoDefault: 'default'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0-rc.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint, so the description carries most of the burden and does well: it discloses the 100000-character cap, how open shadow roots are serialized as <template shadowrootmode>, and how same-origin iframes are appended after an 'if' comment marker. Not covered: what happens with no match for 'query' or whether truncation is signalled in the output.

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?

Two dense sentences that front-load the primary return value and the mode switch, with the alternative tool named last. The heavy parenthetical is information-rich but makes the middle clause harder to parse than necessary.

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?

No output schema exists, yet the description specifies the return shape (HTML string), transform behaviors, size ceiling, and the query-mode variant, which is what an agent needs to interpret results. Absence of no-match behavior is a minor gap for a read-only inspection tool.

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 coverage is 100%, so all five parameters including defaults and the 10000 cap are already documented in structured data. The description adds only a little meaning, mainly that 'query' switches to single-match-plus-context mode rather than an overall filter; the single-sentence format gives it no room to explain before/after interaction.

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 concrete verb and resource ('Returns the page's HTML') plus the second mode triggered by 'query' (first match and its context). It also names the sibling to prefer for element discovery, so an agent can distinguish it from 'snapshot' without opening either schema.

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?

Explicitly routes element-finding work to 'snapshot' and implies this tool is for raw markup or text inspection, which is clear usage context. It does not state when-not to use it relative to other content readers like get_css_styles or get_console_logs, so it falls short of full alternative coverage.

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