Skip to main content
Glama

Snapshot Android UI

mobile_ui_snapshot
Read-onlyIdempotent

Inspect an Android display's accessibility tree to get element refs and exact tap coordinates, then use those refs for tap, swipe, drag, or text actions.

Instructions

Return parsed accessibility nodes, each with a ref (@nN) and the point that actually routes a tap to it. Pass ref to tap, double-tap, long-press, swipe, drag, or text. Refs are shared across HTTP requests until the next UI read on this serial and display. Portable ADB supports only display 0; other displays use the companion hierarchy when a companion session is active.

Input Schema

NameRequiredDescriptionDefault
serialYesExact ADB serial from mobile_devices_list; never inferred when multiple devices exist
displayIdYesAndroid framework logical display ID, not a SurfaceFlinger physical ID

Output Schema

NameRequiredDescriptionDefault
nodesYes
serialYes
backendYes
displayIdYes
truncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.5.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/non-destructive/idempotent, so the safety profile is covered. The description adds genuinely non-obvious behavior beyond that: refs persist across HTTP requests until the next UI read on the same serial+display, and portable ADB only supports display 0. It does not disclose tree size/cost, behavior on an empty or inaccessible hierarchy, or failure modes, which keeps it out of the top band.

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 tightly packed sentences with no filler, and the most decision-relevant facts (what is returned, what to do with it) are front-loaded before the edge-case caveats.

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?

An output schema exists, so return-value documentation is not required, yet the description still characterizes the return (nodes with refs and tap routing) plus ref lifetime and display scope. For a two-parameter read tool this covers everything an agent needs 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% and both required parameters (serial, displayId) are fully documented in the schema, so the baseline is 3. The description's display caveat indirectly informs the displayId value, but it adds little parameter-level syntax or meaning beyond what the schema already states.

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 artifact ('Return parsed accessibility nodes'), and goes further by naming the returned refs (@nN) and the routing point. It also maps itself into the workflow by listing the sibling input tools that consume its refs (tap, double-tap, long-press, swipe, drag, text), so an agent can place it in the toolchain 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?

Gives clear operating context: take the returned ref and pass it to the input tools, and note the display restriction ('Portable ADB supports only display 0; other displays use the companion hierarchy when a companion session is active'). It stops short of explicitly stating when to prefer this over the sibling readers mobile_ui_find / mobile_ui_wait / mobile_screen_capture, so no exclusions or named alternatives are given.

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