Skip to main content
Glama

locator.check

Read-only

Resolve a semantic locator against the live page and report how many elements it matches, helping detect zero or multiple hits before test compilation and execution.

Instructions

Resolve a semantic locator against the live page and report how many elements it hits. A locator matching zero or several is far cheaper to find here than after compiling the test, running it three times and reading a strict-mode failure.

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": {
      "target": "<target>"
    },
    "name": "locator.check"
  }
}

Input Schema

NameRequiredDescriptionDefault
targetYes
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
test_id_attributeNoDefault "data-testid".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered by structured data. The description adds that resolution happens against the live page rather than a saved artifact, which is real added context. It doesn't say whether a zero or multi-match result throws, or how the count is shaped, so the disclosure of behavior beyond the annotations is only partial.

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?

Two sentences, with the core action front-loaded and the justification trailing it. The second sentence earns its place by explaining why this tool exists rather than merely padding. Slight looseness in the rhetorical "three times" phrasing keeps it from a 5.

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

Completeness3/5

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

Four parameters including a nested target object, no output schema, and an open-world read against a live browser is a moderately complex tool. Saying it "reports how many elements it hits" effectively describes the return value, which is helpful. But it leaves ambiguous whether the tool errors or simply returns a count when the locator is ambiguous or unmatched — the exact case the description is selling.

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?

With 75% schema description coverage and a nested target object whose fields (by, name, role, text, exact, label, testId, within) are documented in the schema, the baseline is a 3. The description contributes nothing about parameter meaning — no note on how 'by' enum values map to strategy, nor how within scoping interacts with ambiguity. It neither compensates for nor undermines the schema.

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 states a specific verb and resource: "Resolve a semantic locator against the live page and report how many elements it hits." That is far more than a restatement of "locator.check" and immediately conveys what a caller gets back. It does not, however, differentiate itself from the sibling locator.candidates, so it stops short of 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 Guidelines4/5

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

It gives explicit when-to-use guidance: use this to catch zero-match or multi-match locators before compiling, running repeatedly, and hitting a strict-mode failure. The framing is a cost/benefit comparison against the alternative workflow. It stops short of naming a sibling alternative (e.g., locator.candidates) or stating exclusions, so it's a clear 4 rather than a 5.

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

Deploy Server

Other Tools