Skip to main content
Glama
mobile-debug-mcp

mobile-debug-mcp

get_ui_tree

Retrieves the current UI hierarchy from an Android device or iOS simulator as structured JSON, enabling screen inspection and debugging of mobile apps.

Instructions

Get the current UI hierarchy from an Android device or iOS simulator. Returns a structured JSON representation of the screen content with snapshot metadata and incremental delta signals when available. Successful observations include snapshot_session_id and snapshot_revision for same-device conditional input. Compact errors preserve the error and cannot authorize an expectation. Returns evidence metadata with acquisition intervals and conservative freshness. Optional actionRef links a known same-session/device action; unavailable references collect independently. Device log times are not comparable with host dispatch times.

Input Schema

NameRequiredDescriptionDefault
deviceIdNoDevice Serial (Android) or UDID (iOS). Defaults to connected/booted device.
platformYesPlatform to get UI tree for
actionRefNo
responseModeNodebug
sinceSnapshotRevisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.34.0
    • addedInput schema / allOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "expectedState"
      +      ]
      +    }
      +  }
      +]
    • addedInput schema / properties / actionRef
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "actionId": {
      +      "maxLength": 128,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "sessionId": {
      +      "maxLength": 128,
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "sessionId",
      +    "actionId"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / responseMode
      Added value: +{
      +  "default": "debug",
      +  "enum": [
      +    "compact",
      +    "debug"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / sinceSnapshotRevision
      Added value: +{
      +  "minimum": 1,
      +  "type": "number"
      +}
  2. First observedv0.31.0

TDQS

B3.3/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 discloses substantial behavioral detail: snapshot metadata, incremental delta signals, snapshot_session_id/revision, compact error behavior, evidence metadata, freshness, and actionRef availability semantics. It does not explicitly state read-only/non-destructive status, but the 'Get' framing and rich return/behavior notes are strong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first sentence, but later sentences are dense and somewhat cryptic, especially around compact errors, expectation authorization, and log/dispatch time comparison. The content is not repetitive, but several phrases are harder to parse than necessary.

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?

For a five-parameter tool with nested objects, no annotations, and no output schema, the description does explain return metadata and some operational behavior. However, it leaves important schema semantics undocumented and provides no alternative-tool routing, so it is only partially complete for an agent to invoke confidently.

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 only 40%, so the description must compensate. It adds meaningful context for actionRef and snapshot_revision conditional input, but it does not explain responseMode or sinceSnapshotRevision clearly, and it never directly addresses the platform/deviceId parameters beyond the opening sentence.

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 states a specific verb and resource: getting the current UI hierarchy from Android or iOS, returning structured JSON. It clearly distinguishes the tool from actions like tap or capture_screenshot, though it does not explicitly differentiate it from closer siblings such as get_current_screen or capture_debug_snapshot.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains what the tool returns but gives no explicit guidance on when to use it versus alternatives like get_current_screen, wait_for_ui_change, or find_element. The actionRef note implies a same-session use case, but the description does not state when/when not to use this tool.

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