Skip to main content
Glama

describe_ui

Read the live Android UI hierarchy to get exact element coordinates for tapping, and filter by text, ID, or clickable state to verify what's on screen.

Instructions

Read the on-screen UI hierarchy as a list of elements, each with its text, content_desc, resource_id, class, clickable flag, pixel bounds, and a precomputed center in TRUE DEVICE PIXELS. This is your source of truth for AIMING: pass an element's center straight to tap. Never guess coordinates from the screenshot (it is downscaled and you will miss). The response header states the FOCUSED WINDOW (if it's a system overlay — biometric prompt, permission dialog — the elements belong to that overlay, not your app) and how many nodes the filter hid. Default filter keeps labelled/clickable/id-carrying elements minus redundant wrappers; filter="clickable" returns only tap targets (much smaller); filter="all" returns every bounded node — the only mode where absence proves an element isn't in the CURRENT VIEWPORT's hierarchy. Every mode is viewport-scoped: Android omits a ScrollView's off-screen children from the accessibility tree entirely, so scroll before concluding an element does not exist, and never use this to COUNT a long list (it will undercount) — render_stats reports the whole view tree. Canvas-drawn (RN/Flutter/Skia) content appears in NO mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoCase-insensitive substring to match against text, content_desc, and resource_id — return only matching elements. The cheap way to ask 'is X on this screen?'. Combine with filter='all' to prove absence definitively.
filterNoWhat to include: 'auto' (default — elements with text, content_desc, resource_id, or clickable; identical-bounds label-less wrappers dropped), 'clickable' (tap targets only, the smallest view), or 'all' (every bounded node, unfiltered — use to PROVE an element is absent from the CURRENT VIEWPORT). 'all' is still viewport-scoped: Android omits off-screen ScrollView children from the accessibility tree, so scroll before concluding absence, and use render_stats (not this) to count a long list.
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
compactNoReturn one line per element (center, bounds, flags, labels) instead of JSON — ~10x fewer tokens, same aiming information. Use for repeated look-drive loops and geometry work.
packageNoOptional package expected to own the focused window. If another app or SystemUI owns focus, the response calls that out explicitly.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.23.0
    • changedInput schema / properties / filter / description
      Previous value: -"What to include: 'auto' (default — elements with text, content_desc, resource_id, or clickable; identical-bounds label-less wrappers dropped), 'clickable' (tap targets only, the smallest view), or 'all' (every bounded node, unfiltered — use to PROVE an element is absent from the hierarchy)."New value: +"What to include: 'auto' (default — elements with text, content_desc, resource_id, or clickable; identical-bounds label-less wrappers dropped), 'clickable' (tap targets only, the smallest view), or 'all' (every bounded node, unfiltered — use to PROVE an element is absent from the CURRENT VIEWPORT). 'all' is still viewport-scoped: Android omits off-screen ScrollView children from the accessibility tree, so scroll before concluding absence, and use render_stats (not this) to count a long list."
  2. First observedv1.0.0

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. It reveals critical behaviors: focused-window detection including system overlays, hidden-node count in the response header, viewport scoping for all modes, Android's omission of off-screen ScrollView children, and complete invisibility of canvas-drawn content. This is rich, non-obvious behavioral context.

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 carries distinct operational value: output contents, aiming rule, screenshot warning, response header, filter modes, viewport limitation, and canvas limitation. The structure front-loads the core purpose and progressively adds edge-case warnings without 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?

Since there is no output schema, the description must explain what the tool returns, and it does: per-element fields, header contents, compact format, and all critical limitations. It also tells the agent how to interpret absence and when to delegate counting to render_stats. Nothing needed for correct invocation and interpretation is missing.

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 reinforces filter semantics and the viewport caveat, but the schema already explains query, filter, serial, compact, and package in comparable detail. The description adds no substantial parameter-level meaning beyond the schema.

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 and resource: 'Read the on-screen UI hierarchy as a list of elements' followed by the exact fields returned. It explicitly differentiates from screenshots by calling itself the 'source of truth for AIMING' and warns against guessing coordinates from the downscaled screenshot, clearly separating it from sibling tools like screenshot and render_stats.

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?

The description gives explicit when-to-use and when-not-to-use guidance: use render_stats instead for counting long lists, scroll before concluding absence, filter='all' to prove absence in the current viewport, and compact mode for repeated look-drive loops. It also names the screenshot alternative to avoid. This is far beyond implied usage.

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