Skip to main content
Glama

Robot Actions — Remote Device Control

device_locators_for

Generate ranked locator strategies for a UI element on Android. Pass either coordinates (x, y — picks the smallest containing element) OR a text/contentDesc/resourceId to look up. Returns the same priority-ordered list the UI inspector shows: id, text, content-desc, accessibility selector, XPath. Use these to fill page-object selectors when generating test scripts so you do not have to re-derive them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoPhysical x coordinate of the element (use with y)
yNoPhysical y coordinate of the element (use with x)
textNoLookup by visible text (matches text or content-desc)
udidYesDevice serial number (UDID)
resourceIdNoLookup by resource-id
contentDescNoLookup by content-desc / accessibility label

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the output list and the coordinate behavior (picks smallest containing element), but it does not explicitly state read-only status, device connection requirements, or error handling. For a generation tool the safety profile is implied but not stated.

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?

Three sentences with no waste. Purpose is front-loaded, followed by input options, output format, and use case. Every sentence earns its place.

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?

The description covers the output format, use case, and input guidance. It omits explicit read-only status and error scenarios, but these are not critical for a locator-generation tool. Overall it provides enough for an agent to call it correctly.

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?

The schema fully documents each parameter, but the description adds meaningful semantics: x/y must be used together, and text/contentDesc/resourceId are alternative lookup modes. It also explains that coordinates select the smallest containing element, which goes beyond the schema.

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 clearly states the tool generates ranked locator strategies for Android UI elements, with a specific verb and resource. It distinguishes itself from siblings like device_find_element and ios_locators_for by platform and output purpose.

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 explicitly describes the use case (filling page-object selectors) and clarifies the input modes (coordinates vs text/contentDesc/resourceId). It does not explicitly name alternatives or when not to use it, but the purpose is distinct enough to guide selection.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources