Skip to main content
Glama

Check locator

check_locator

Counts how many elements an Appium locator matches on a screen and reports whether it is visible. Accepts Python, Java, and @AndroidFindBy/@iOSXCUITFindBy locator formats.

Instructions

How many elements an Appium locator matches on a screen (1 = good) and whether it's visible. Accepts Python (AppiumBy.X, "v"), Java AppiumBy.x("v") and @AndroidFindBy / @iOSXCUITFindBy forms.

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

Input Schema

NameRequiredDescriptionDefault
screenNo
locatorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations at all, the description carries the full burden. It does disclose the return semantics (match count plus visibility) and accepted locator syntaxes, which is genuinely useful, but says nothing about whether a live session/driver is required, what happens with a malformed locator, or whether the call has any side effects.

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 tight sentences, front-loaded with the outcome the caller cares about and followed by the input formats. No filler, though the locator-format clause is dense and could be split for readability.

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?

A small two-parameter tool with no output schema, so the description's job is to cover inputs and results. It covers results and locator formats but leaves the screen parameter and failure modes unexplained, which is a clear gap for an unattended agent.

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 0%, so the description must compensate. It does well for the required locator parameter by enumerating the Python, Java and @AndroidFindBy/@iOSXCUITFindBy forms, but the screen parameter (nullable, default null) gets no explanation at all, leaving half the surface undocumented.

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 concrete operation (count matches, check visibility) on a specific resource (an Appium locator on a screen) and even defines the success criterion "1 = good". An agent can distinguish it from heal_locator or accessibility_check, though it never explicitly names a sibling.

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

Usage Guidelines3/5

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

Usage is only implied: the "(1 = good)" note suggests using it to validate a locator before relying on it, but there is no explicit when-to-use, when-not-to-use, or named alternative such as heal_locator for fixing a bad locator.

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