Skip to main content
Glama
HyperClockUp

DrissionPageMCPServer_Modified

by HyperClockUp

get_dom_tree

Extract structured DOM tree data to analyze page hierarchy, generate precise element selectors, and understand layout relationships for web automation workflows.

Instructions

获取DOM树结构(结构化分析工具)

        ⚠️ 核心分析工具:这是标准化工作流程的第3步!
        
        🎯 主要用途:
        1. 📋 获取页面的层次化结构信息
        2. 🔍 为元素定位提供精确的选择器路径
        3. 🎯 分析页面布局,理解元素间的父子关系
        4. 🛠️ 为非多模态LLM提供详细的结构化信息
        
        💡 与其他工具的协作:
        - 在 take_screenshot() 和 get_page_text() 之后使用
        - 为 find_elements() 提供选择器构建依据
        - 配合 get_element_text() 验证元素内容
        
        Args:
            selector: 起始选择器(默认"body"获取整个页面结构)
            max_depth: 最大遍历深度(默认10层,避免过深嵌套)
            
        Returns:
            str: 结构化的DOM树信息,包含标签、属性、层级关系
            
        🚀 使用建议:
        - 首次分析页面:使用默认参数获取完整结构
        - 聚焦特定区域:指定具体的selector缩小范围
        - 复杂页面:适当减少max_depth避免信息过载
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNobody
max_depthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It effectively describes the tool's behavior: it's an analysis tool that returns structured DOM tree information with tags, attributes, and hierarchical relationships. It warns about potential information overload with complex pages and suggests reducing max_depth. However, it doesn't mention performance characteristics, error conditions, or what happens with invalid selectors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (core analysis tool, main purposes, tool collaboration, args, returns, usage suggestions) but contains some redundancy and could be more concise. The emoji decorations and formatting add visual clarity but don't contribute essential information. The content is front-loaded with purpose information, but some sections like the four main purposes could be more succinctly expressed.

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?

Given the tool's complexity (DOM tree analysis with 2 parameters) and the presence of an output schema (which covers return values), the description is remarkably complete. It covers purpose, workflow positioning, collaboration with other tools, parameter semantics, usage scenarios, and behavioral considerations. The description compensates for the lack of annotations and 0% schema description coverage by providing comprehensive context about how and when to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds significant semantic meaning beyond the input schema, which has 0% description coverage. It explains that 'selector' is the '起始选择器' (starting selector) with default 'body' to get the entire page structure, and 'max_depth' controls '最大遍历深度' (maximum traversal depth) with default 10 to avoid deep nesting. It provides practical guidance on when to use each parameter, including using default for initial analysis, specifying selector to focus on specific areas, and reducing max_depth for complex pages.

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 '获取DOM树结构' (gets DOM tree structure) with specific verbs like '获取' (get/acquire) and '分析' (analyze). It distinguishes from siblings by focusing on structured hierarchical analysis rather than screenshots, text extraction, or element interaction. The description explicitly lists four main purposes including obtaining hierarchical structure, providing selector paths, analyzing layout relationships, and supplying structured information to non-multimodal LLMs.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool versus alternatives. It states this is '标准化工作流程的第3步' (step 3 of the standardized workflow) and should be used '在 take_screenshot() 和 get_page_text() 之后' (after take_screenshot() and get_page_text()). It also specifies collaboration with other tools like find_elements() and get_element_text(), and provides three specific usage scenarios with recommendations for different contexts.

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/HyperClockUp/DrissionPageMCPServer_Modified'

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