Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

workflow-tap-element

Find and tap UI elements by label, input text, and verify with screenshot in a single call, reducing token usage by internalizing intermediate accessibility checks and element search.

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
elementQueryYesSearch term for element (e.g., "Login", "Submit")
inputTextNoText to type after tapping
verifyResultNoTake screenshot after action
udidNoTarget device
screenContextNoScreen name for tracking
Behavior5/5

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

Discloses internal steps, fallback behavior, non-fatal error handling, and delays. Since annotations are absent, this fully covers behavioral traits without contradiction.

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?

Well-structured with sections, examples, and bullet points, though slightly verbose. Every part earns its place, but could be tightened without losing clarity.

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?

Fully documents return values and provides guidance for a complex workflow with no output schema. Covers all necessary context for effective use.

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?

Adds value beyond schema: case-insensitive partial matching, default values, and detailed examples. Schema coverage is 100%, so baseline 3; extra examples push to 4.

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 it's a high-level workflow for tapping UI elements by name, distinguishing it from sibling tools like idb-ui-tap and idb-ui-find-element.

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?

Includes a dedicated 'Why Use This Workflow?' section explaining token efficiency and reduced context pollution, and lists related tools. Explicit guidance on when to use and alternatives.

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