Skip to main content
Glama

tap_element

Destructive

Find and tap an iOS app element by text, identifier, or type, waiting for it to appear and scrolling when needed.

Instructions

Find an element by text, identifier or type, wait for it to appear (5 s by default), and tap its center once. Prefer this to tap when the target is in the accessibility tree. Pass at least one of text, id or type. System alerts are searched before the app. Returns the element tapped, and the match count when there are several; fails if none appears in time. With scrollDirection it scrolls to find off-screen elements.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tap_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoExact accessibility identifier
textNoCase-insensitive. Exact matches on label, identifier, value or placeholder rank first, then whole-word matches inside a short label, identifier or placeholder
typeNoElement type, e.g. Button, TextField, Cell, Switch
exactNoRequire an exact text match
indexNoPick the Nth best match (0-based)
deviceNoDevice UDID or name substring. Defaults to the select_device choice, then IOS_DEVICE_MCP_DEVICE, else the single USB-connected device.
timeoutNoSeconds to wait for the element (default 5)
maxScrollsNoScroll attempts when scrollDirection is set (default 8)
recordAudioNoRecord the Mac microphone around the tap. The tap is sent once audio is actually being captured, and the result gives its offset in the file
scrollDirectionNoIf not found, scroll this way and look again (lists load lazily, so off-screen rows may not exist yet)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.2
    • changedInput schema / properties / text / description
      Previous value: -"Matches label, identifier, value or placeholder (exact first, then substring, case-insensitive)"New value: +"Case-insensitive. Exact matches on label, identifier, value or placeholder rank first, then whole-word matches inside a short label, identifier or placeholder"
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations only declare it is a non-readonly, destructive, non-idempotent call; the description supplies the behavior that matters: the default 5 s wait, that system alerts are searched before the app, the return payload (element tapped plus match count), and the failure condition. It does not explain what makes the tap destructive or how it interacts with ongoing drivers, so it stops short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five tight sentences with the core action and preference first, then preconditions, then edge behaviors. Nothing is redundant with the annotations and no sentence is filler.

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 ten-parameter tool with a nested recordAudio object and no output schema, the description covers selection, waiting, fallback scrolling, failure, and the returned value, so an agent can call it correctly without further context.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds a constraint the schema cannot express because nothing is required: at least one of text, id or type must be supplied. It also restates the default wait and the scroll-fallback behavior in prose, though it leaves exact/index precedence to the schema.

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 — 'Find an element by text, identifier or type... tap its center once' — and explicitly contrasts itself with the sibling 'tap' by naming the condition that selects it (target is in the accessibility tree). An agent can differentiate it without opening the 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?

Gives a direct alternative comparison ('Prefer this to tap when the target is in the accessibility tree'), a precondition ('Pass at least one of text, id or type'), and a conditional mode ('With scrollDirection it scrolls to find off-screen elements'). Other siblings like wait_for_element or long_press are not addressed, but the guidance needed to choose between the two tap paths is explicit.

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