Skip to main content
Glama

Dump UI Hierarchy

ui_dump
Read-onlyIdempotent

Captures the current screen's UI view hierarchy as XML via UI Automator, so you can inspect displayed elements and understand exactly what an Android device is showing.

Instructions

Dump the current screen's UI hierarchy (view tree) as XML using UI Automator. Useful for understanding what's displayed on screen

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ui_dump"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceIdNoTarget device serial
compressedNoUse compressed format for smaller output

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds that the dump is produced via UI Automator and returned as XML, which is useful context. It doesn't mention typical output size, latency, or what the compressed flag changes behaviorally.

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?

Two short sentences, purpose first, no filler or redundant restatement of the name. Every clause carries information (mechanism, format, typical use).

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 zero-required-parameter, read-only, annotation-rich tool with no output schema, the description covers what it produces (an XML view tree) and how, which is the main thing an agent needs. It only lacks a note on output volume for large hierarchies and a pointer to the screenshot sibling.

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%, so both deviceId and compressed are already documented in the schema, establishing the baseline of 3. The description adds no meaning beyond that, e.g. it never hints that 'compressed' trades readability for output size.

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?

States a specific verb and resource — 'Dump the current screen's UI hierarchy (view tree) as XML using UI Automator' — with the output format and mechanism identified. It stops short of distinguishing itself from the closest sibling, device_screenshot, which also serves 'understanding what's displayed on screen'.

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?

'Useful for understanding what's displayed on screen' implies a use case but gives no explicit when-to-use/when-not or points to alternatives such as device_screenshot or device_shell. Usage is inferable but not directed.

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