Skip to main content
Glama

Get UI Elements

get_ui_elements

Retrieve UI element tree from a mobile device screen to understand what is displayed and decide where to tap. Each element includes index, text, content description, class name, resource ID, bounding box with center coordinates, and boolean states (clickable, scrollable, focusable, enabled, selected, checked). By default returns only interactive elements; set interactive_only to false to get all elements.

Instructions

Retrieve the current UI element tree from the device screen. Each element includes its index, text, content description, class name, resource ID, bounding box with center coordinates (useful for tap targets), and boolean states (clickable, scrollable, focusable, enabled, selected, checked). By default only interactive elements are returned. Set interactive_only to false to get all elements. This is the primary tool for understanding what is on screen and deciding where to tap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYesDevice serial ID
interactive_onlyNoOnly return interactive elements (clickable, focusable, scrollable)
Behavior3/5

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

No annotations provided, so description carries full burden. It describes that 'By default only interactive elements are returned' and that setting interactive_only to false gets all elements. It doesn't disclose performance characteristics, caching, or side effects, which are minor gaps for a read tool.

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?

Four sentences, each adding essential information: purpose, data fields, default behavior, and usage guidance. No filler words. Front-loaded with purpose.

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?

For a retrieval tool with no output schema and no annotations, the description adequately covers what data is returned (fields enumerated) and how to control filtering. It is complete enough given the tool's complexity. Slight deduction for not mentioning performance or rate limits.

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 baseline is 3. The description adds value beyond schema by explaining the default behavior of interactive_only and its purpose (returning interactive elements vs all). This lifts the score to 4.

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 clearly states 'Retrieve the current UI element tree from the device screen' with specific verb 'Retrieve' and resource 'UI element tree'. It distinguishes itself from siblings like 'tap' and 'take_screenshot' by explicitly positioning as 'the primary tool for understanding what is on screen and deciding where to tap.'

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?

The description provides context on when to use it: 'primary tool for understanding what is on screen and deciding where to tap.' However, it does not explicitly state when not to use it or mention alternatives among siblings (e.g., 'analyze_screen' or 'find_element'), missing explicit contrast.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/saranshbamania/mobile-device-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server