Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

idb-ui-find-element

Search the accessibility tree by label or identifier to locate UI elements. Obtain tap-ready coordinates (centerX, centerY) to interact with controls directly, eliminating the need for visual screenshots.

Instructions

idb-ui-find-element

Find UI elements by semantic search in accessibility tree - no screenshots needed.

Overview

Queries the accessibility tree and searches for elements matching a label or identifier. Returns matching elements with tap-ready coordinates (centerX, centerY), enabling agents to find specific UI controls without visual analysis. Fast semantic search replaces screenshot-based visual scanning for complex UIs.

Parameters

Required

  • query (string): Search term to match against element labels or identifiers

Optional

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

Returns

Array of matching elements with:

  • Type, label, identifier

  • Tap-ready coordinates (centerX, centerY)

  • Full frame boundaries (x, y, width, height)

Returns empty array if no matches found.

Examples

Find login button

const result = await idbUiFindElementTool({
  query: 'login'
});

Find email field on specific device

const emailField = await idbUiFindElementTool({
  query: 'email',
  udid: 'DEVICE-UDID'
});

Find by identifier partial match

const search = await idbUiFindElementTool({
  query: 'submit'
});

How It Works

  1. Query accessibility tree: Calls idb ui describe-all (~80ms)

  2. Filter by query: Searches element labels and identifiers (case-insensitive partial match)

  3. Return coordinates: Provides tap-ready centerX/centerY for direct use with idb-ui-tap

  • accessibility-quality-check: Quick assessment of accessibility data richness

  • idb-ui-describe: Full accessibility tree with all element details

  • idb-ui-tap: Tap elements using coordinates

  • screenshot: Visual fallback if accessibility insufficient

Notes

  • Uses case-insensitive partial matching ("log" matches "Login")

  • Returns all matching elements (filter in agent logic if needed)

  • Only returns elements with valid frame coordinates

  • Much faster than visual analysis (~80ms vs 2000ms for screenshot)

  • 5-6x cheaper token cost (~40 tokens vs ~170 for screenshot)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNo
queryYes
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses key behaviors: case-insensitive partial matching, returns all matches, only elements with valid coordinates, and performance metrics (~80ms, 5-6x cheaper tokens). It also explains internal workflow (calls idb ui describe-all). This is comprehensive and transparent.

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?

The description is well-structured with clear sections (Overview, Parameters, Returns, Examples, How It Works, Related Tools, Notes). It is front-loaded with the core purpose. While somewhat lengthy, each section provides valuable information and earns its place.

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?

Despite no output schema, the description fully explains the return format (array with type, label, identifier, coordinates, frame boundaries) and covers the empty array case. It also gives usage context, performance trade-offs, and related tools. The description is complete for an agent to invoke correctly.

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

Parameters4/5

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

The input schema has no descriptions (0% coverage), so the description adds essential meaning. It explains query as a search term for labels/identifiers and udid as an optional target identifier with auto-detection. Examples illustrate usage. However, it does not specify constraints like allowed characters or format, which would be helpful.

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?

The description clearly states the tool finds UI elements via semantic search in the accessibility tree and returns tap-ready coordinates. It distinguishes itself from siblings like screenshot (visual fallback) and idb-ui-describe (full accessibility tree), establishing a unique role.

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

Usage Guidelines4/5

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

The description explains when to use (fast semantic search replacing screenshot analysis for complex UIs) and lists related tools with their purposes (e.g., accessibility-quality-check to assess data richness, idb-ui-tap for tapping). It clearly guides selection but does not explicitly state 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.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/conorluddy/xc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server