Skip to main content
Glama
Himangguo
by Himangguo

get_dom_tree

Retrieve the DOM subtree of a live webpage, starting from a CSS selector or the document root, with configurable depth up to 10 for debugging hierarchy.

Instructions

获取 DOM 子树结构,可按选择器定位根节点,depth 控制层级深度(最大 10)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNo子树深度,默认 3,最大 10
selectorNoCSS 选择器(可选,不传则从文档根开始)
Behavior3/5

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

No annotations are provided, so the description carries the burden for behavioral disclosure. It adds useful details like maximum depth (10) and default depth (3), and that selector is optional. However, it does not describe the return format, potential side effects, or edge cases (e.g., empty selector match). This is moderate transparency.

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?

The description is a single, front-loaded sentence that covers purpose and key parameters without waste. Every phrase contributes meaning.

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?

For a relatively simple read tool with only two optional parameters and no output schema, the description is sufficient to guide selection and invocation. It covers main behavior and constraints (depth max 10, selector default). Minor gaps like return structure are not critical given the tool's simplicity and schema coverage.

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% for both parameters (depth, selector), and the schema already provides clear descriptions. The main description essentially restates what the schema says without adding new semantic meaning. Baseline 3 is appropriate since schema does the heavy lifting.

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's function: '获取 DOM 子树结构' (get DOM subtree structure), with a specific verb and resource. It also mentions key capabilities (selector for root node, depth control) and is distinct from sibling tools like get_ancestors and query_selector.

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 description implies usage context: you can specify a selector to start from a particular node and depth to control recursiveness. However, it does not explicitly state when to use this tool over alternatives (e.g., get_ancestors, query_selector) or provide exclusions. Usage is implied but not fully guided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Himangguo/chrome-devtools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server