Skip to main content
Glama

dom.get_html

Read-only

Retrieve HTML markup for a targeted element or whole document; stores full content as an artifact while returning a bounded inline window.

Instructions

Markup of one element or of the whole document. Always stored as an artifact; only a bounded window is returned inline.

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.get_html"
  }
}

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.
max_charsNo
save_pathNo
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
whole_documentNo
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
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries real informational weight: it discloses that the full markup is persisted as an artifact and that only a bounded window comes back inline — a critical expectation about truncated output. It stops short of naming the artifact handle or how to retrieve it, which keeps it from a 5.

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 short sentences, no filler, with the scope statement first and the artifact/truncation caveat second. Nothing is repeated from the schema or annotations.

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?

For a 12-parameter, zero-required tool with no output schema, the definition covers the most important surprise (artifact storage plus truncated inline return) but omits how to obtain the full artifact, the size of the inline window, and default behavior when no locator is given. Adequate for safe invocation, thin for efficient use.

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 75%, so the baseline is 3; the three undocumented parameters are max_chars, save_path, and whole_document. The description indirectly touches whole_document ('the whole document') and the bounded inline window that max_chars controls, but gives no defaults, units, or semantics for save_path, so compensation is only partial.

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

Purpose3/5

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

The description identifies the resource (HTML markup) and its two scopes (one element vs. the whole document), which is slightly more than the name 'dom.get_html' already implies. However, it is a bare noun phrase with no verb and no differentiation from siblings that also surface page content (dom.export, dom.query, doc.get), so an agent must still infer the exact operation.

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, no mention of when to prefer dom.query/dom.inspect or artifact.read instead, and no prerequisites. The only implicit routing hint is that content is stored as an artifact, but the description never tells the agent to follow up with artifact.read.

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