Skip to main content
Glama

获取 DOM 样式快照

get_dom_snapshot

Inspect any element's DOM subtree as a text snapshot with geometry, computed styles, and text, including shadow DOM, to verify colors, layout, and positioning without a screenshot.

Instructions

对指定元素的子树生成「虚拟截图」:每个可见节点一行,含几何(rect)、关键 computed style(颜色/背景/字号/边框/圆角/阴影/透明度/z-index/溢出)、文本,穿 shadow DOM。纯文本、无需任何授权,是验证颜色、布局、定位的首选;需要真实渲染像素(canvas 内容、图片、遮挡观感)时再用 get_screenshot。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo操作说明:展示给页面用户的自然语言描述(用户会在页面气泡的操作记录里看到),用用户的语言填写,建议始终提供
depthNo最大递归深度,默认 4,上限 8
pageIdNo目标页面 id(单页时可省略)
maxNodesNo最多输出的节点数,默认 60,上限 300
selectorYesCSS 选择器(深度查询,穿 shadow DOM),对其子树生成快照
Behavior4/5

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

无注解,描述承担了行为披露责任。说明这是纯文本操作、无需授权,只输出可见节点,且穿 shadow DOM,这补充了安全性和执行行为。虽然未讨论 maxNodes/depth 截断或返回失败情况,但关键行为已明确。

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?

两句话紧凑完成功能说明、输出内容说明、适用场景和替代工具路由,信息密度高且无冗余。关键行为前置,替代方案收尾,结构清晰。

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?

无输出 schema,描述说明了输出内容(每行几何、样式、文本),无注解时也覆盖了授权和只读性。5 个参数中必需项在 schema 中已有定义,整体对调用该工具所需上下文已足够;仅缺少对截断或 selector 无效时的行为说明。

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 描述覆盖率为 100%,参数本身在 schema 中已有完整说明。描述没有额外深化参数语义,但也不构成负担,按 baseline 3 评分合理。

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?

描述明确说明对指定元素子树生成「虚拟截图」,包含几何、样式、文本和 shadow DOM 穿透,动词和资源具体。与 get_screenshot 的差异通过「需要真实渲染像素时再用 get_screenshot」直接点出,能清晰区别于兄弟工具。

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?

描述明确给出使用场景:验证颜色、布局、定位的首选;并明确列出何时应改用 get_screenshot(canvas 内容、图片、遮挡观感)。提供了 when-to-use 和 when-not-to-use 的清晰指引。

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/kirakiray/web-bridge-mcp'

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