Skip to main content
Glama
WebTrace MCP Server

WebTrace MCP Server

by kings0527

dom_snapshot

Capture a DOM summary of a target tab, including visible text, inputs, buttons, links, and forms, to give AI agents page structure for analysis.

Instructions

读取目标标签页的DOM摘要,包括可见文本、输入框、按钮、链接和表单。

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_snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo目标标签页 URL,可传完整 URL 或前缀。
tabIdNo目标标签页 ID。
maxElementsNo
includeHiddenNo
maxTextLengthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It does imply a read-only operation (读取) and discloses the visibility filter by emphasizing 可见文本, which usefully pairs with includeHidden defaulting to false. However, it never warns that the result is a truncated summary capped by maxElements (default 200) and maxTextLength (default 20000), a material trait for an agent parsing the output.

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

Conciseness4/5

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

A single front-loaded sentence with the resource first and the returned content second; nothing is redundant. The brevity is appropriate in form, though it borders on underspecified rather than tight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

A 5-parameter tool with no annotations, no output schema, and 40% schema coverage needs more than one sentence. Missing are tab-selection precedence between url and tabId, truncation behavior of the summary, and any indication of how the result differs from sibling DOM tools.

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

Parameters2/5

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

Schema coverage is only 40% across 5 parameters; includeHidden, maxElements, and maxTextLength have no schema descriptions at all. The description only indirectly hints at includeHidden via 可见文本 and at summarization limits via 摘要, adding no meaning for the truncation or hidden-element parameters.

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?

States a specific verb and resource (读取目标标签页的DOM摘要) and enumerates the content returned (可见文本、输入框、按钮、链接、表单), so an agent knows exactly what it gets. It does not distinguish itself from siblings like query_dom or page_state, which is the only thing keeping it from a 5.

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 guidance on when to choose this over query_dom or page_state, both of which appear to operate on DOM content. No prerequisites are stated either, such as whether the target tab must already be active or how url versus tabId selection works.

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