Skip to main content
Glama

get_dom_tree

Extracts the visible page as structured data: rendered text, heading outline, and numbered interactive elements that action tools target by numeric id.

Instructions

Extracts the visible page as structured data: rendered text, a heading outline, and a numbered list of interactive elements (links, buttons, inputs, selects, contenteditable). Action tools target elements by their numeric id.

Input Schema

NameRequiredDescriptionDefault
privacyNostrict masks every input value.default
clientIdNoOptional target page; defaults to the most recently active page.
include_textNoInclude the rendered visible text of the page.
max_elementsNoCap for numbered interactive elements.
max_text_charsNoCharacter cap for the text field.
include_outlineNoInclude the heading/section outline.
include_interactiveNoInclude numbered interactive elements.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description must carry the behavioral load. It discloses that only the visible rendered page is captured (not raw DOM/HTML) and that interactive elements come back numbered, which is meaningful beyond the schema. It does not state that the call is a non-mutating snapshot, that results can be truncated by the defaults, or what the returned structure looks like beyond a field list.

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 sentences, zero filler, and the output composition is front-loaded before the note about numeric ids. Every clause carries information an agent needs.

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?

Seven optional parameters with full schema coverage and no output schema means the description has to convey return shape, and it does so by listing the three sections. The only gap is that it never explains that defaults trim the output (150 elements, 12000 chars), so an agent could underestimate truncation without reading the schema.

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% — every parameter including privacy, clientId, max_elements and max_text_chars is documented in the schema itself. The description adds nothing per-parameter, so the baseline 3 applies: the schema does the work and the prose neither helps nor hurts.

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?

"Extracts the visible page as structured data" names a concrete verb and resource, and the description enumerates the three payloads (rendered text, heading outline, numbered interactive elements). It also implicitly separates this capture step from the action siblings by noting that action tools target elements by numeric id, though it never names list_pages, scroll_page, or the others directly.

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

Usage Guidelines3/5

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

The line "Action tools target elements by their numeric id" hints that this tool must be called before click_element or input_text to obtain those ids, which is real usage context. However, there is no explicit when-to-use statement, no guidance on when to skip it (e.g. after acting on a page that has already been captured), and no mention of when to prefer list_pages instead.

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