Skip to main content
Glama

get_ui

Retrieves the visible Android UI element list with stable refs, text, IDs, and bounds so agents can target taps or text entry; returns a screenshot if no UI tree is available.

Instructions

The visible UI as a list of elements: [ref] (stable across calls), text, desc, id, centre, size, flags. Target elements by ref (index), text or id. Falls back to a screenshot when no tree is available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
allNoInclude layout-only nodes
serialNoadb serial; optional when exactly one device is connected

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations the description carries the full burden, and it does disclose real behavior: ref is stable across calls and the call degrades to a screenshot when no tree exists. It omits anything about device/connection requirements (e.g. adb serial resolution) or failure modes beyond the fallback.

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?

Three compact clauses, front-loaded with the return shape and with no filler. The middle clause about targeting elements is utility-oriented toward other tools but still earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must describe the return value, and it does so field by field, including the stability guarantee for refs and the screenshot fallback. For a two-optional-param read tool that is nearly complete; only connection/permission preconditions are absent.

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 both parameters ('all' for layout-only nodes and 'serial') are already documented in the schema. The description adds nothing about either parameter; its 'ref (index), text or id' clause describes output addressing, not input arguments.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific resource ('the visible UI') and the exact shape of what comes back (a list of elements with ref/text/desc/id/centre/size/flags), which lets an agent tell it apart from screenshot or get_screen_info. It stops short of an explicit verb form ('get') and never names the sibling to prefer in a given situation.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: 'Target elements by ref (index), text or id' tells the agent how the result feeds into tap/scroll, and the screenshot fallback hints at when the tree is unavailable. There is no explicit 'use this instead of screenshot when...' routing or precondition for calling it.

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