Skip to main content
Glama
XC-MCP: XCode CLI wrapper

XC-MCP: XCode CLI wrapper

by conorluddy

Describe Accessibility Tree

idb-ui-describe
Idempotent

Query the iOS accessibility tree to discover tappable elements, text fields, and tap coordinates for UI automation. Assess data quality and validate elements at points before tapping.

Instructions

idb-ui-describe

🔍 Query UI accessibility tree - discover tappable elements and text fields for precise automation

What it does

Queries iOS accessibility tree to discover UI elements, their properties (type, label, enabled state), coordinates (frame, centerX, centerY), and accessibility identifiers. Returns full tree with progressive disclosure (summary + cache ID for full data), element-at-point queries for tap validation, and data quality assessment (rich/moderate/minimal) to guide automation strategy. Automatically parses NDJSON output to extract all elements (not just first), includes AXFrame coordinate parsing for precise tapping, and caches large outputs to prevent token overflow.

Progressive Filtering: Supports 4 filter levels for element discovery - start conservative with moderate filtering (default), escalate to permissive/none if minimal data found.

iOS Compatibility: Recognizes iOS-specific accessibility fields (role, role_description, AXLabel, AXFrame) in addition to standard fields.

Why you'd use it

  • Discover all tappable elements from accessibility tree - buttons, cells, links identified by JSON element objects

  • Get precise tap coordinates (centerX, centerY) for elements without needing screenshots

  • Assess data quality before choosing automation approach - rich data enables precise targeting, minimal data requires screenshots

  • Validate tap coordinates by querying elements at specific points before execution

  • Progressive disclosure prevents token overflow on complex UIs - get summary first, full tree on demand

  • Progressive filter escalation - start with moderate filtering, escalate to permissive/none if minimal data found

Deep reads

For operation all, deep: true opts into axbridge. It enables device accessibility automation mode, which idb does not restore. Default reads retain the ordinary accessibility backend.

Parameters

Required

  • operation (string): "all" | "point"

Point operation parameters

  • x (number, required for point operation): X coordinate to query

  • y (number, required for point operation): Y coordinate to query

Optional

  • udid (string): Target identifier - auto-detects if omitted

  • screenContext (string): Screen name for context (e.g., "LoginScreen")

  • purposeDescription (string): Query purpose (e.g., "Find tappable button")

  • filterLevel (string): "strict" | "moderate" | "permissive" | "none" (default: "moderate")

    • strict: Only obvious interactive elements via type field (original behavior)

    • moderate: Include iOS roles (role, role_description) - DEFAULT, fixes iOS button detection

    • permissive: Any element with role/type/label information

    • none: Return everything (debugging)

Returns

For "all": UI tree summary with element counts (total, tappable, text fields), data quality assessment (rich/moderate/minimal), top 20 interactive elements preview with centerX/centerY coordinates, uiTreeId for full tree retrieval, current filter level, and guidance on automation strategy including suggestions to escalate filter level if minimal data found.

For "point": Element details at coordinates including type, label, value, identifier, frame coordinates (x, y, centerX, centerY), enabled state, and tappability.

Examples

Query full UI tree with default moderate filtering

const result = await idbUiDescribeTool({
  operation: 'all',
  screenContext: 'LoginScreen',
  purposeDescription: 'Find email and password fields'
});
// Result includes elements with centerX, centerY for direct tapping

Progressive filter escalation pattern

// 1. Start with default (moderate)
let result = await idbUiDescribeTool({ operation: 'all' });

// 2. If minimal data, try permissive
if (result.summary.dataQuality === 'minimal') {
  result = await idbUiDescribeTool({
    operation: 'all',
    filterLevel: 'permissive'
  });
}

// 3. If still minimal, try none (return everything)
if (result.summary.dataQuality === 'minimal') {
  result = await idbUiDescribeTool({
    operation: 'all',
    filterLevel: 'none'
  });
}

// 4. If STILL minimal, fall back to screenshots
if (result.summary.dataQuality === 'minimal') {
  // Use screenshot-based approach
}

Validate element at tap coordinates

const element = await idbUiDescribeTool({
  operation: 'point',
  x: 200,
  y: 400
});
// Element includes frame coordinates if available
  • idb-ui-tap: Tap discovered elements using centerX/centerY coordinates

  • screenshot: Capture screenshot for visual element identification

  • idb-ui-find-element: Semantic element search by label/identifier

  • accessibility-quality-check: Quick assessment before choosing approach

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": {
      "operation": "<operation>"
    },
    "name": "idb-ui-describe"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
deepNoOpt in to axbridge; enables device accessibility automation mode, which idb does not restore.
udidNo
operationYes
screenContextNo
purposeDescriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.0.0
    • addedInput schema / properties / deep
      Added value: +{
      +  "description": "Opt in to axbridge; enables device accessibility automation mode, which idb does not restore.",
      +  "type": "boolean"
      +}
  2. Addedv1.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already indicate it is non-destructive, idempotent, and not read-only. The description adds important behavioral context beyond them: progressive disclosure caching to prevent token overflow, filter-level escalation, and the critical note that deep:true enables an axbridge mode that idb does not restore. It does not cover authorization or all side effects, but the key state-changing caveat is disclosed.

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 content is front-loaded and well-sectioned, but it is very long and repeats the progressive filter escalation in the Why, Returns, and Examples sections. The examples are useful, yet the definition could be tightened without losing required information.

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?

There is no output schema, but the description thoroughly explains the returns for both operation modes, including summary fields, data quality levels, cached uiTreeId retrieval, and point-query element details. For a complex query tool with two operations, this is complete enough for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 14%, so the description must carry parameter meaning, and it does. It explains operation values, x/y for point queries, udid auto-detection, screenContext and purposeDescription intent, all filterLevel enum values with defaults, and the deep mode's behavioral implication. This compensates fully for the sparse schema descriptions.

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?

States a specific verb and resource: queries the iOS accessibility tree to discover UI elements, coordinates, and identifiers. It clearly distinguishes itself from semantic search and screenshot-based tools via the Related Tools section, so an agent can select it without opening another 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?

Provides explicit when-to-use guidance across multiple scenarios: discovering tappable elements, getting tap coordinates, assessing data quality, validating tap points, and handling token overflow. It also names alternatives and describes a progressive filter escalation workflow, leaving little to inference.

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