Skip to main content
Glama

Robot Actions — Remote Device Control

Device page source

device_page_source
Read-onlyIdempotent

Get UI hierarchy XML of a device . Bounds are in physical pixel coordinates — use them directly with device_tap/device_swipe (no scaling needed). Supports element filtering by text/class and compact description format. Pass search to grep the dump case-insensitively across text/content-desc/class/resource-id — the fast way to check if a target is present. If it is NOT in the dump it may be scrolled off-screen (Android only dumps rendered nodes): use device_scroll_to_element to bring it in, device_find_element/device_locators_for to resolve a stable locator, or device_wait_for_element to wait out animations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoFilter: only return elements where text or content-desc matches this string
udidYesDevice serial number (UDID)
formatNoOutput format: xml (default) or description (compact readable list)
searchNoCase-insensitive substring grepped across the whole node (text, content-desc, class, resource-id). Looser than `text` (which is an exact text=/content-desc= match) — use it to locate an element without knowing its exact label.
classNameNoFilter: only return elements matching this class name (e.g. android.widget.Button)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / search / description
      Previous value: -"Case-insensitive substring grepped across the whole node (text, content-desc, class, resource-id). Looser than `text` (which is an exact text=/content-desc= match) — use it to locate an element without knowing its exact label."New value: +"Case-insensitive substring grepped across the whole node (text, content-desc, class, resource-id). Looser than `text` (which is an exact text=/content-desc= match) — use it to locate an element without knowing its exact label."
  2. Changed1 schema field changed
    • changedInput schema / properties / search / description
      Previous value: -"Case-insensitive substring grepped across the whole node (text, content-desc, class, resource-id). Looser than `text` (which is an exact text=/content-desc= match) — use it to locate an element without knowing its exact label."New value: +"Case-insensitive substring grepped across the whole node (text, content-desc, class, resource-id). Looser than `text` (which is an exact text=/content-desc= match) — use it to locate an element without knowing its exact label."
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare the safe read-only, idempotent profile, and the description adds substantial non-obvious behavior: bounds are in physical pixels needing no scaling for device_tap/device_swipe, and only rendered nodes appear in the dump so off-screen elements are missing. It does not mention output size or cost for large hierarchies.

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?

The core purpose and the critical pixel-coordinate note are front-loaded, and each subsequent sentence carries distinct information (filtering, search semantics, fallback tools). It is slightly dense at four sentences for a read tool, but nothing is wasted.

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?

No output schema exists, yet the description explains both output shapes (xml vs compact description list), the coordinate system of the returned bounds, the search behavior, and what to do when an element is absent. An agent has everything needed to call it correctly.

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 100%, so the baseline is 3. The description restates filtering by text/class, compact format, and the case-insensitive grep semantics of `search`, but adds no syntax, default, or constraint details beyond what the schema already documents.

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 and resource ('Get UI hierarchy XML of a device') and implicitly scopes itself to Android via the caveat that 'Android only dumps rendered nodes', distinguishing it from ios_page_source and session_page_source in the sibling list.

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

Usage Guidelines5/5

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

Explicitly routes the agent: 'Pass `search` ... the fast way to check if a target is present', and if the target is absent, names three concrete alternatives (device_scroll_to_element, device_find_element/device_locators_for, device_wait_for_element) each with the condition that selects it.

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