Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Tap Element (Workflow)

workflow-tap-element

Find and tap UI elements by name, optionally enter text, and verify with a screenshot—combining accessibility checks into one call to reduce context usage.

Instructions

workflow-tap-element

High-level semantic UI interaction - find and tap elements by name without coordinate hunting.

Overview

Orchestrates accessibility-first UI automation in a single call:

  1. Check Accessibility - Assess UI richness for automation approach

  2. Find Element - Semantic search by label/identifier

  3. Tap Element - Execute tap at discovered coordinates

  4. Input Text (optional) - Type into tapped field

  5. Verify Result (optional) - Screenshot for confirmation

This workflow keeps intermediate results internal, reducing agent context usage by ~80% compared to calling each tool manually.

Parameters

Required

  • elementQuery (string): Search term for element (e.g., "Login", "Submit", "Email")

    • Case-insensitive partial matching ("log" matches "Login")

Optional

  • inputText (string): Text to type after tapping (for text fields)

  • verifyResult (boolean): Take screenshot after action (default: false)

  • udid (string): Target device - auto-detected if omitted

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

Returns

Consolidated result with:

  • success: Overall workflow success

  • tappedElement: Found element details (type, label, coordinates)

  • inputText: Text entry status (if requested)

  • verified: Screenshot status (if requested)

  • accessibilityQuality: UI richness assessment

  • totalDuration: Total workflow time

  • guidance: Next steps

Examples

Tap Login Button

{"elementQuery": "Login"}

Finds and taps the Login button.

Tap Email Field and Enter Text

{
  "elementQuery": "Email",
  "inputText": "user@example.com",
  "screenContext": "LoginScreen"
}

Finds email field, taps it, enters text.

Full Verification Workflow

{
  "elementQuery": "Submit",
  "verifyResult": true,
  "screenContext": "SignupForm"
}

Taps Submit button and captures verification screenshot.

Why Use This Workflow?

Token Efficiency

  • Manual approach: 4-5 tool calls × ~50 tokens each = ~200+ tokens in responses

  • Workflow approach: 1 call with consolidated response = ~80 tokens

Reduced Context Pollution

  • Intermediate accessibility data not exposed

  • Element search results summarized

  • Only actionable outcome returned

Error Handling

  • Graceful degradation on partial failures

  • Helpful guidance when element not found

  • Clear troubleshooting steps

  • idb-ui-find-element: Direct element search (used internally)

  • idb-ui-tap: Direct tap (used internally)

  • accessibility-quality-check: Direct quality check (used internally)

  • workflow-fresh-install: Clean app installation workflow

Notes

  • Falls back gracefully if accessibility is minimal

  • Non-fatal errors (input, screenshot) don't fail the workflow

  • Element matching uses partial, case-insensitive search

  • Small delay between tap and input for keyboard appearance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNoTarget device
inputTextNoText to type after tapping
elementQueryYesSearch term for element (e.g., "Login", "Submit")
verifyResultNoTake screenshot after action
screenContextNoScreen name for tracking

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.9/5.0
Behavior5/5

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

The annotations are minimal (readOnlyHint=false, destructiveHint=false, etc.), so the description carries the burden. It discloses the workflow's orchestration, fallback behavior on minimal accessibility, non-fatal error handling, internal result handling, and a small delay between tap and input. This goes beyond the schema and annotations, fully informing the agent of side effects and failure modes.

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 long but well-structured with clear sections (Overview, Parameters, Returns, Examples, Why Use This, Related Tools, Notes). It front-loads the purpose and each section earns its place. Some redundancy exists (parameter descriptions repeated in both schema and text), but the structure keeps it navigable.

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 workflow tool with 5 parameters, no output schema, and significant behavioral nuance, the description covers everything necessary: parameters, return values, examples, error handling, and related tools. An agent can call it correctly without additional context.

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?

The schema already describes all parameters, but the description adds critical semantic details: case-insensitive partial matching for elementQuery, auto-detection for udid, default for verifyResult, and example usage. It enriches the schema's bare descriptions with actionable guidance.

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 explicitly states it's a high-level semantic UI interaction tool that finds and taps elements by name, distinguishing itself from siblings by orchestrating multiple steps (accessibility check, find, tap, optional input, verify) in one call. It clearly differentiates from idb-ui-tap and idb-ui-find-element by being a workflow that reduces context usage.

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?

It explicitly explains when to use this workflow versus calling underlying tools manually, citing token efficiency and reduced context pollution. It also lists related tools and describes the 'Why Use This Workflow?' section, giving clear guidance on when to prefer this tool over direct calls.

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