Skip to main content
Glama

dump_ui

Read-only

Capture the current Android screen's UI hierarchy as a JSON tree with class, text, resource ID, bounds, and interaction flags, enabling QA inspection and test automation.

Instructions

Dump the current screen's UI hierarchy (uiautomator) as a JSON tree: class, text, resource_id, content_desc, bounds [x1,y1,x2,y2] and flags (clickable, scrollable, ...).

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": "dump_ui"
  }
}

Input Schema

NameRequiredDescriptionDefault
serialNo
compactNoDrop layout-only wrapper nodes (recommended).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds that the output is a uiautomator-derived JSON tree rather than an image, but the field list (class, text, resource_id, bounds, flags) largely restates what the existing output schema already defines.

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?

Two compact sentences with no filler, and the key noun phrase ('current screen's UI hierarchy') is front-loaded. The enumerated field list is slightly redundant given the output schema, which keeps it from a 5.

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 read-only inspection tool with a documented output schema and annotation-covered safety profile, this is adequate: the agent knows what is returned and that nothing is mutated. Minor gaps remain around behavior when no device is attached or when the screen is in a transitional state.

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?

The description says nothing about serial or compact. Both parameters do carry schema descriptions ('Optional when one device is online', 'Drop layout-only wrapper nodes'), so the schema at least marginally covers the 50% coverage signal, but the description itself adds no meaning beyond it.

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 verb (dump) and resource (current screen's UI hierarchy) and identifies the underlying mechanism (uiautomator) plus the shape of the result. It does not name a sibling alternative such as screenshot, though the 'hierarchy' framing implicitly separates it from a pixel capture.

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 only implied: an agent can infer this is for inspecting on-screen elements before acting on them, but the description never states when to prefer it over screenshot or when it is unnecessary. No preconditions or exclusions are given.

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