Skip to main content
Glama

describe

Read-only

Read the accessibility or DOM element tree of the current screen to locate element frames and labels for UI interaction when no fresh tree is available.

Instructions

Get the accessibility / DOM element tree for the current screen. Use when you need element frames or labels and have no fresh tree: most interaction tools (not shake) already return one after each action, or name an identical earlier one by its tree id. On iOS it reads the AXRuntime accessibility service, so it sees whatever is visible, including system dialogs and permission prompts. While a system dialog is visible it returns the dialog's elements (buttons, text); otherwise the foreground app's. On a physical iOS device it covers only the app started with launch-app; to read system dialogs there, launch-app com.apple.springboard first. On a local iOS simulator a text field shows its placeholder as its value, with no label, so an empty field reads like one holding that text. A text field with no accessibility label or identifier (e.g. the Settings search field) can also be missing from the tree, even with text typed in it. Check a screenshot in both cases. On Android it reads the tree through Argent's UiAutomation helper, falling back to uiautomator dump. On Chromium it walks the DOM over the Chrome DevTools Protocol: every visible element with its ARIA role, accessible name and the visible part of its bounding rect; content scrolled or clipped out of view, or skipped by a closed <details> or content-visibility: hidden, has a zero-area frame. On Vega (Fire TV) it reads the on-device automation toolkit; [focused]/[selected] mark the D-pad cursor, which you move with tv-remote (Vega has no touch). On a TV target (Apple TV / Android TV: a list-devices entry with runtimeKind 'tv') it returns the FOCUSED element and the FOCUSABLE elements instead, since a TV UI has no tap coordinates. Move the highlight with tv-remote, then read where focus landed from the tree in its result, or call describe again when it is missing.

Returns { description, source }: description renders the tree one line per element, with its role, label/value/id, VoiceOver hint (iOS simulator), interactivity flags and frame. Frames are normalized [0,1] fractions of the screen / window width and height (not pixels); tap an element at the centre of its frame. The tree has no z-order or occlusion information: an element may be covered by an overlay (e.g. a toolbar over list rows), so check a screenshot when a tap lands unexpectedly. Fails if the tree cannot be read, e.g. on a physical iOS device before launch-app has started an app.

For UIKit properties of a view (class name, accessibilityIdentifier), use native-find-views (iOS simulator only). For React Native component names, or a testID describe does not list, use debugger-component-tree.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "udid": "<udid>"
    },
    "name": "describe"
  }
}

Input Schema

NameRequiredDescriptionDefault
udidYesTarget device id from `list-devices` (iOS UDID, Android serial, Vega serial, or Chromium id).
bundleIdNoApp bundle ID, used as a target hint on iOS when the AX-service returns no elements and describe falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on every other platform, including a physical iOS device.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / bundleId / description
      Previous value: -"Optional app bundle ID. Used as a target hint on iOS when the AX-service returns no elements and the describe tool falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on Android / Chromium, and on a physical iOS device."New value: +"App bundle ID, used as a target hint on iOS when the AX-service returns no elements and describe falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on every other platform, including a physical iOS device."
  2. Changed1 schema field changedv0.24.0
    • changedInput schema / properties / bundleId / description
      Previous value: -"Optional app bundle ID. Used as a target hint on iOS when the AX-service returns no elements and the describe tool falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on Android / Chromium."New value: +"Optional app bundle ID. Used as a target hint on iOS when the AX-service returns no elements and the describe tool falls back to native-devtools inspection. If omitted, the fallback auto-detects the frontmost connected app. Ignored on Android / Chromium, and on a physical iOS device."
  3. First observedv0.15.0

TDQS

A4.4/5.0
Behavior4/5

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

With only readOnlyHint supplied, the description carries real weight and delivers: per-platform read mechanisms (AXRuntime, UiAutomation/uiautomator dump, CDP DOM walk, Vega toolkit), TV focus-only semantics, normalized [0,1] frames, the absence of z-order/occlusion data, and an explicit failure condition. The main uncovered behavior is latency/cost and whether repeated calls are cheap. Minor iOS quirks (placeholder-as-value, unlabeled fields omitted) are disclosed with a mitigation ('check a screenshot').

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?

Front-loaded: the purpose and the when-to-use rule occupy the first two sentences, and the reference sections (return shape, failure, alternatives) come last. It is long, but nearly every sentence is a platform-specific caveat that changes how an agent interprets results; only the duplicated 'check a screenshot' advice in two separate paragraphs reads as redundant.

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

Completeness5/5

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

For a read-only, multi-platform tool with no output schema, it covers the return contract ({description, source}), the frame coordinate system the agent must use to tap, failure modes, and platform divergence including TV focus semantics. Nothing an agent needs to call it correctly or interpret its output is missing.

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% and both parameters are well documented in the schema itself, so the baseline is 3. The description adds adjacent context — 'a list-devices entry with runtimeKind tv' and Chromium ids as valid udid targets, and the launch-app dependency — but never explains bundleId's fallback role or that it is ignored off iOS, leaving the schema to do that work.

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?

Opens with a specific verb+resource+scope: 'Get the accessibility / DOM element tree for the current screen.' It then differentiates itself from the family of interaction tools that already return a tree, and from native-find-views and debugger-component-tree, so an agent can pick it without opening any schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ('when you need element frames or labels and have no fresh tree') and when-not-to-use ('most interaction tools (not shake) already return one after each action, or name an identical earlier one by its tree id'). It also routes to named alternatives for the adjacent needs: native-find-views for UIKit properties, debugger-component-tree for RN component names or an unlisted testID.

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