Skip to main content
Glama
WebTrace MCP Server

WebTrace MCP Server

by kings0527

query_dom

Reads DOM node text, attributes, visibility, and optional outerHTML from a target tab using a CSS selector, enabling precise page inspection for debugging and automation.

Instructions

按CSS选择器读取目标标签页DOM节点的文本、属性、可见性和可选outerHTML。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "query_dom"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo目标标签页 URL,可传完整 URL 或前缀。
limitNo
tabIdNo目标标签页 ID。
selectorYesCSS 选择器。
includeHiddenNo
includeOuterHTMLNo
maxOuterHTMLLengthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It reveals the shape of the payload (text/attributes/visibility/outerHTML) but says nothing about read-only safety, behavior on multiple matches, how limit truncates results, whether hidden nodes are included by default, or what happens when the tab is not found.

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 enumerating the returned fields with no filler or redundancy. It is efficient, though the terse one-liner structure leaves no room for the usage and behavioral context that is missing elsewhere.

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?

With 7 parameters, no annotations, and no output schema, the description should explain result shape, defaults, and tab targeting. It covers only the returned field list and one optional flag, leaving the majority of the parameter surface and error behavior unexplained.

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 description coverage is only 43% (url, tabId, selector documented; limit, includeHidden, includeOuterHTML, maxOuterHTMLLength not). The description only hints at the includeOuterHTML toggle ('可选outerHTML') and leaves limit, includeHidden, and tab resolution undocumented in both schema and prose, so it does not compensate for the coverage gap.

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?

The description gives a specific verb (读取/read) and resource (目标标签页 DOM 节点) and enumerates what is extracted: text, attributes, visibility, and optional outerHTML. It is clear what the tool returns, though it never names a sibling such as dom_snapshot to draw the boundary between targeted selector queries and full snapshots.

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 when-to-use guidance: nothing says when to prefer this over dom_snapshot or page_state, or when to supply url versus tabId. The only implied usage is 'you have a CSS selector', which an agent must infer from the parameter list rather than from the description.

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