Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Tap UI Element

idb-ui-tap

Tap iOS UI elements at exact coordinates, auto-converting screenshot positions to device space, with support for single, double, and long-press gestures on simulators and physical devices.

Instructions

idb-ui-tap

🎯 Tap at coordinates on iOS screen - core UI automation primitive with screenshot coordinate transformation

What it does

Sends precise tap events to iOS targets at specified screen coordinates with automatic coordinate transformation from screenshot space to device space. Supports single tap, double tap, and long press gestures. Validates coordinates against device screen bounds and provides semantic action tracking for test documentation. Works on both simulators and physical devices over USB/WiFi.

Why you'd use it

  • Automate UI interactions from screenshot analysis - tap elements identified visually

  • Transform screenshot coordinates automatically when screenshots are resized for token efficiency

  • Validate tap coordinates against device bounds before execution to prevent out-of-range errors

  • Track test scenarios with semantic metadata (actionName, expectedOutcome, testScenario, step)

Parameters

Required

  • x (number): X coordinate (device coords or screenshot coords with applyScreenshotScale)

  • y (number): Y coordinate (device coords or screenshot coords with applyScreenshotScale)

Optional

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

  • numberOfTaps (number, default: 1): Number of taps (set 2 for double-tap)

  • duration (number): Long press duration in milliseconds

  • applyScreenshotScale (boolean): Transform screenshot coords to device coords

  • screenshotScaleX (number): Scale factor for X axis from screenshot-inline

  • screenshotScaleY (number): Scale factor for Y axis from screenshot-inline

  • actionName (string): Semantic action name (e.g., "Login Button Tap")

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

  • expectedOutcome (string): Expected result (e.g., "Navigate to HomeScreen")

  • testScenario (string): Test scenario name (e.g., "Happy Path Login")

  • step (number): Step number in test workflow

Returns

Tap execution status with transformed coordinates, input coordinate details (if transformed), action context metadata for test tracking, error details if failed, and verification guidance.

Examples

Tap from screenshot coordinates (auto-transformed)

const result = await idbUiTapTool({
  x: 150, y: 300,
  applyScreenshotScale: true,
  screenshotScaleX: 2.0, screenshotScaleY: 2.0,
  actionName: "Login Button Tap",
  expectedOutcome: "Navigate to HomeScreen"
});
  • idb-ui-describe: Discover tappable elements and their coordinates

  • screenshot: Capture screenshot to identify tap targets

  • idb-ui-gesture: For swipes and hardware buttons

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYes
yYes
stepNo
udidNo
durationNo
actionNameNo
numberOfTapsNo
testScenarioNo
screenContextNo
expectedOutcomeNo
screenshotScaleXNo
screenshotScaleYNo
applyScreenshotScaleNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.5/5.0
Behavior4/5

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

The description adds useful behavioral context beyond the annotations: automatic screenshot-to-device coordinate transformation, coordinate bounds validation, support for simulators and physical devices over USB/Wi-Fi, and semantic action tracking. While annotations already indicate non-read-only, non-idempotent behavior, the description enriches the agent's understanding with actionable details about input validation and transformation. It could mention a requirement like a booted target, but that is a minor gap.

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 headings, bullet lists, and an example that aids comprehension. It is somewhat long and the opening 'What it does' slightly restates the title and the header line, but given 13 parameters and 0% schema coverage, the length is justified.

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 complex 13-parameter tool with no output schema and no schema parameter descriptions, the description carries the entire burden and succeeds. It covers all parameters, return behavior, an example, and relationships with other tools. An agent can invoke this tool correctly with no gaps in meaning.

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 0%, yet the description compensates thoroughly. It explains each parameter's meaning beyond its type: x/y coordinate space with applyScreenshotScale, UDID auto-detection when omitted, duration for long press, and the semantic metadata fields (actionName, expectedOutcome, etc.). This is exactly the value the description is expected to add.

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 immediately states a specific action and resource: 'Sends precise tap events to iOS targets at specified screen coordinates.' It clearly differentiates this tool from related siblings like idb-ui-gesture (swipes/hardware buttons) and idb-ui-describe (discovering tappable elements), leaving no ambiguity about what it does.

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 'Why you'd use it' section provides clear use cases such as tapping elements identified in screenshots, transforming coordinates automatically, validating bounds, and tracking test metadata. The 'Related Tools' section also names alternatives with their roles, which helps agents choose the right tool. However, it lacks explicit 'when not to use' guidance beyond those brief sibling descriptions.

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