Skip to main content
Glama

Robot Actions — Remote Device Control

android_devtools_elements

Extract locator-friendly element data from a page on the device for building Playwright/Selenium locators. For each element (interactive/meaningful elements by default, or those matching selector) returns: tag, trimmed text, key attributes (id/name/type/role/aria-label/placeholder/href/value/data-testid + any data-*), classes, bounding box {x,y,w,h} and a visibility flag. USE suggested — the locator worth writing (id, then test-id, name, aria-label, placeholder), each verified unique before it is offered, with playwright giving the same target in getByRole/getByTestId form. css and xpath are diagnostic fallbacks, not recommendations: the CSS path is an nth-of-type chain over layout classes and does not belong in a page object. When suggested is null nothing stable exists — act via ref and treat the missing test-id as the real finding. Set includeStyles=true to also return a curated set of computed styles per element. Omit pageId to auto-select the visible/active page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesDevice serial number (UDID)
limitNoMax elements to return (default 150)
pageIdNoTarget page id (auto-picked when omitted)
socketNoAbstract unix socket name (default: chrome_devtools_remote)
selectorNoCSS selector to scope extraction (default: interactive/meaningful elements)
includeStylesNoInclude a curated set of computed styles per element (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It explains filtering defaults (interactive/meaningful elements), the selector scoping, the uniqueness verification of suggested locators, the diagnostic nature of css/xpath, the null-suggested fallback behavior, the optional computed styles, and page auto-selection. This goes well beyond a simple one-liner and leaves an agent well-informed about the tool's behavior.

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?

The description is dense but every sentence earns its place. It front-loads the core purpose and return structure, then logically flows into locator recommendations, fallback behavior, and optional parameters. Despite its length, there is no redundancy or filler.

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

Completeness5/5

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

There is no output schema, so the description must fully explain the return format, and it does: fields, locator recommendations, fallbacks, and null handling. It also covers parameter defaults and edge cases (suggested null, pageId omission). For a read-only extraction tool with no annotations, this is a complete picture for an agent to invoke 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?

Schema description coverage is 100%, giving a baseline of 3. The description adds meaningful semantics for several parameters: selector scoping, includeStyles returning a curated style set, and pageId auto-selection when omitted. While udid, limit, and socket are not elaborated beyond the schema, the added context for key parameters raises the score above baseline.

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 opens with a specific verb+resource+scope: 'Extract locator-friendly element data from a page on the device for building Playwright/Selenium locators.' It also enumerates the exact return fields (tag, text, attributes, bounding box, visibility), which leaves no ambiguity about the tool's job. The focus on locator generation distinguishes it from siblings like android_devtools_get_dom or device_find_element.

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?

The description provides strong contextual guidance on how to use the output (prefer `suggested`, treat `css`/`xpath` as diagnostic fallbacks, handle `suggested` null as a real finding). However, it does not explicitly name alternative tools or state when NOT to use this tool versus a sibling such as android_devtools_get_dom or device_locators_for. This is a minor gap given that the use case is clearly implied.

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