Skip to main content
Glama

dump_ui_hierarchy

Dump the current Android screen's layout tree as XML to expose visible UI elements for inspection and automation.

Instructions

Dump the current layout tree (UI hierarchy XML) of the screen using uiautomator. Highly useful for AI agents to inspect what UI elements are currently visible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialNoSpecific device serial number
Behavior2/5

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

No annotations are provided, so the description carries full burden of behavioral disclosure. While 'Dump' implies a read-only operation, the description does not mention side effects, permissions, or how the output is delivered (e.g., stored as a file on device vs. returned directly). It lacks detail on potential behavioral traits beyond the basic action.

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 two concise sentences, front-loaded with the core action and purpose. Every part contributes value, and there is no unnecessary elaboration.

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

Completeness3/5

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

The tool has one optional parameter and no output schema. The description clearly explains the tool's purpose and when to use it, but it does not specify the output format or behavior (e.g., whether the XML is returned or saved as a file). This leaves some ambiguity for an agent invoking the tool.

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 coverage is 100% for the only parameter (serial), and the description adds no extra meaning about it. The baseline of 3 applies since the schema already documents the parameter sufficiently, and the description does not need to compensate for any gaps.

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 uses a specific verb 'Dump' and resource 'current layout tree (UI hierarchy XML)', clearly identifying the tool's function. It also mentions 'using uiautomator' and 'inspect what UI elements are currently visible', which distinguishes it from sibling tools like take_screenshot or get_dumpsys.

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 clear context for when to use the tool ('Highly useful for AI agents to inspect what UI elements are currently visible'), implying it should be used when UI structure understanding is needed. It does not explicitly mention alternatives or exclusions, but the context is sufficient for basic selection.

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/abhinav7895/adb-mcp-server'

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