Skip to main content
Glama

Robot Actions — Remote Device Control

Android DevTools elements

android_devtools_elements
Read-onlyIdempotent

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.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds substantial behavior: the exact return shape, that suggested locators are verified unique before being offered, the null-suggested edge case, and that css is an nth-of-type chain over layout classes not fit for page objects. This is context well beyond structured fields.

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?

Front-loaded with purpose and return shape, and every sentence carries weight (fallback warnings, null handling, style flag, page auto-select). Some sentences are dense multi-clause runs, but there is little pure 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?

With no output schema, the description carries the full burden and does so: it enumerates returned fields (tag, text, attributes, classes, bbox, visibility), the suggested/playwright/css/xpath structures, and the null case. An agent has everything needed to call and interpret it.

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 coverage is 100%, so the baseline is 3, but the description adds meaning: selector scopes extraction to matching elements vs the interactive/meaningful default, includeStyles returns a curated computed-style set, and omitting pageId auto-selects the visible/active page. That is genuine semantic enrichment over the schema strings.

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?

States a specific verb (extract) and resource (locator-friendly element data from a device page), plus the downstream purpose (building Playwright/Selenium locators). An agent can distinguish this from android_devtools_get_dom, device_find_element and device_locators_for without opening any schema.

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?

Strong prescriptive guidance: 'USE suggested', css/xpath are diagnostic fallbacks not recommendations, when suggested is null act via ref, set includeStyles for computed styles, omit pageId to auto-select. It lacks an explicit contrast with sibling tools like android_devtools_get_dom, but the in-tool usage rules are clear and actionable.

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