Skip to main content
Glama

Robot Actions — Remote Device Control

device_page_source

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.9/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 disclosure burden and shoulders it well: it reveals that Android only dumps rendered nodes (scrolled-off elements are missing), that bounds are raw physical pixels usable directly with device_tap/device_swipe, and that `search` is a case-insensitive substring vs the exact `text` match. These are non-obvious behaviors an agent must know to avoid false-negative conclusions.

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?

Five front-loaded sentences with zero filler: core purpose first, then the highest-risk facts (coordinate semantics, rendered-nodes limitation), then filter options, and finally fallback routing. Every clause carries actionable information an agent needs before invoking.

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 compensates by explaining what the dump contains (physical-pixel bounds) and its key limitation (only rendered nodes), plus what to do when an element is missing. Combined with 100% schema parameter coverage, nothing an agent needs to call it correctly and react to results is missing.

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. The description adds incremental value by framing parameters as a task strategy: filtering by text/class, the compact description output format, and using `search` as the fast, deliberately looser presence check. It doesn't add new syntax beyond the schema, but it helps the agent choose which parameter fits the goal.

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.' It goes beyond a terse purpose by anchoring the tool to Android (only rendered nodes are dumped) and by referencing the device_* sibling family, so an agent can distinguish it from ios_page_source or the session/web page-source tools without opening their schemas.

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?

Explicit when-to-use guidance: `search` is described as 'the fast way to check if a target is present,' and the description directly instructs the agent to switch to device_scroll_to_element, device_find_element/device_locators_for, or device_wait_for_element when the target is absent from the dump. It gives both positive usage conditions and explicit fallback routing to named alternatives.

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