Skip to main content
Glama
helmif

semantic-dom-mcp

by helmif

extract_semantic_dom

Navigate to a page and return semantic JSON of interactive elements with Playwright-native locators and live state, enabling accurate test selectors without guessing.

Instructions

Navigate to a staging URL and return factual Semantic JSON of all interactive/test-relevant elements with Playwright-native locators and live state. Use this before writing any Playwright test so selectors are real, not guessed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe page to extract. Must be http/https and on an allowlisted host.
viewportNoViewport preset — 'mobile' is 375x812 with touch, for responsive states.desktop
wait_forNoNavigation wait condition.networkidle
max_nodesNoCap on extracted nodes; truncation is flagged, never silent.
wait_selectorNoOptional selector to await before extracting (for SPA content).
include_hiddenNoKeep hidden nodes flagged rather than dropping them.
include_click_targetsNoOpt-in heuristic: also include cursor:pointer elements with content that match no other rule (JS-click product cards without anchors/roles/test-ids). Heuristic nodes carry a context_note.
Behavior3/5

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

With no annotations provided, the description must disclose behavioral traits. It mentions navigation to a staging URL, returning semantic JSON, and flags truncation behavior. However, it does not explicitly state that the operation is read-only or address potential side effects, authorization needs, or rate limits. The description adds some behavioral context but lacks completeness.

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 extremely concise with two sentences. The first sentence delivers the core purpose and key output details, and the second provides clear usage guidance. Every sentence serves a purpose, and the key information is front-loaded.

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?

Given 7 parameters with full schema coverage and no output schema or annotations, the description covers the tool's purpose, usage timing, and parameter behaviors well. It lacks details about the exact JSON output structure and error handling, but the overall context is sufficient for an agent to use the tool effectively.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds significant value beyond the schema by providing behavioral details, such as truncation being flagged not silent (max_nodes), mobile viewport size and touch context (viewport), SPA content hint (wait_selector), and heuristics for cursor:pointer elements (include_click_targets). This elevates the score above baseline.

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 uses a specific verb ('Navigate to a staging URL and return factual Semantic JSON') and clearly identifies the resource (interactive/test-relevant elements with Playwright-native locators). It also distinguishes from the sibling tool 'extract_semantic_dom_after' by indicating this is for use before writing tests, making the purpose unmistakable.

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

Usage Guidelines4/5

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

The description explicitly states when to use this tool: 'Use this before writing any Playwright test so selectors are real, not guessed.' This provides clear context, though it does not explicitly mention when not to use it or name alternative tools (e.g., extract_semantic_dom_after) as exclusions.

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/helmif/semantic-dom-mcp'

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