Skip to main content
Glama
helmif

semantic-dom-mcp

by helmif

verify_locators

Read-onlyIdempotent

Counts Playwright locator expressions against a live page to return match counts, uniqueness, and the first matched element per expression for test validation and CI drift checks.

Instructions

Count every given Playwright expression against the live page (same engine that verified the extraction). Use after writing a test: paste the spec's getBy*/locator expressions and get matches, uniqueness, and the first matched element per expression, plus a summary. Also the drift check to run in CI against a page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe page to extract. Must be http/https and on an allowlisted host.
locatorsYesPlaywright expressions as written in the test (getByRole(...), getByTestId(...), scoped forms, .nth(i)).
viewportNoViewport preset — 'mobile' is 375x812 with touch, for responsive states.desktop
wait_forNoNavigation wait. 'auto' (default) waits for load, then until the DOM has been quiet for 500ms (max 6s) — works on SPAs that render after load and on pages whose analytics never let the network go idle. 'networkidle' times out on such pages.auto
wait_selectorNoOptional selector to await before extracting (for SPA content).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare this is a safe, read-only, idempotent, non-open-world operation, so the bar is lower. The description adds real value beyond them by disclosing the return shape (matches, uniqueness, first matched element per expression, plus a summary) and the CI drift-check scenario.

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?

Three sentences, front-loaded with the core action, then usage and a secondary CI scenario. Dense but every clause carries information; no filler.

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?

With no output schema, the description compensates by describing what the tool returns. Combined with fully documented parameters and safety annotations, an agent has enough to call it correctly, though the relationship to session_verify_locators remains unspecified.

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 description coverage is 100%, so all five parameters including url, locators, viewport, wait_for, and wait_selector are already documented with defaults, enums, and constraints. The description adds no parameter-level detail beyond what the schema provides, so the baseline 3 applies.

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: counting Playwright expressions against a live page, and notes it uses the same engine that verified the extraction. The purpose is unambiguous, but it does not explicitly distinguish itself from the sibling session_verify_locators, leaving the agent to infer the difference.

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?

Gives clear when-to-use context: 'Use after writing a test' with instructions to paste the spec's getBy*/locator expressions, and a second use case as a CI drift check. No exclusions or explicit sibling comparison are provided, but the triggering conditions are concrete.

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