Skip to main content
Glama

Check locator

check_locator

Count how many elements a Selenium locator matches on a page and check visibility to confirm it targets exactly one visible element.

Instructions

Count what a Selenium locator matches on a page (1 = good) and whether it is visible.

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": {
      "url": "<url>",
      "locator": "<locator>"
    },
    "name": "check_locator"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYes
locatorYes
sessionNoOptional: reach a page behind a login or several steps into a flow

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full burden. It discloses the two outputs (match count and visibility) but says nothing about whether it navigates to the given url, how long it waits for elements, or whether an invalid locator raises an error versus returning 0.

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?

One dense sentence with the core behavior front-loaded and no filler. The '(1 = good)' aside is slightly cryptic but earns its place as an interpretation hint.

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?

For a simple three-parameter check tool with no output schema and no annotations, the description should explain how the page is reached and how the two return values are shaped. It covers what is measured but leaves the navigation and failure semantics unstated.

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 coverage is 33%: only session is documented in the schema, while url and locator lack top-level descriptions (the locator format example lives in the nested Step definition, not here). The description ties locator to Selenium syntax and url to 'a page', adding modest meaning, but contributes no format detail.

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 what a Selenium locator matches on a page, plus a visibility check. That is concrete enough to distinguish it from a locator-repair tool like heal_locator, though no sibling is named.

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?

The parenthetical '(1 = good)' hints that a single match is the desired outcome, which implies this is a validation step. But there is no explicit when-to-use, when-not, or pointer to heal_locator for the case where the count is wrong.

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