Skip to main content
Glama

ui_tree

Dump and parse the Android screen UI hierarchy into compact clickable/text nodes with center coordinates, or return only added, changed, and removed nodes as a delta since the previous snapshot.

Instructions

Dump and parse the current Android screen UI hierarchy into compact clickable/text nodes with center coordinates (cx,cy). Set onlyChanged=true to return a delta diff (+/~/-) against the previous snapshot.

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_tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
onlyChangedNoWhen true, return only added (+), changed (~), and removed (-) nodes since the previous ui_tree snapshot.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 does reasonably well: it discloses that the result is a parsed node list rather than raw XML, gives the coordinate convention (cx,cy), and reveals statefulness by describing a delta against 'the previous snapshot'. It does not mention permission/accessibility requirements or failure behavior if no snapshot exists yet.

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 sentences, both front-loaded with the highest-value information (what it does, then the output format, then the optional delta mode). Nothing is redundant or padding.

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, single-optional-param tool with no output schema, the description supplies the essential return semantics (parsed nodes with center coordinates). Minor gaps remain around node attributes returned and first-call behavior under onlyChanged, but an agent has enough to invoke it correctly.

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 the only parameter is already fully documented in the schema, including the +/-/~ meanings. The description restates the same delta semantics without adding syntax or edge-case behavior (e.g. what happens on the first call with no prior snapshot), so baseline 3 applies.

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?

The description opens with a specific verb pair and resource ('Dump and parse the current Android screen UI hierarchy') and states the output shape ('compact clickable/text nodes with center coordinates (cx,cy)'). That is concrete enough that an agent can tell it is not the screenshot tool, though no sibling is named explicitly.

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 the tool to inspect tappable elements before calling tap or swipe. There is no explicit when-to-use or when-not guidance, and no named alternative such as screenshot for visual inspection.

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