tap_element
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
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Exact accessibility identifier | |
| text | No | Case-insensitive. Exact matches on label, identifier, value or placeholder rank first, then whole-word matches inside a short label, identifier or placeholder | |
| type | No | Element type, e.g. Button, TextField, Cell, Switch | |
| exact | No | Require an exact text match | |
| index | No | Pick the Nth best match (0-based) | |
| device | No | Device UDID or name substring. Defaults to the select_device choice, then IOS_DEVICE_MCP_DEVICE, else the single USB-connected device. | |
| timeout | No | Seconds to wait for the element (default 5) | |
| maxScrolls | No | Scroll attempts when scrollDirection is set (default 8) | |
| recordAudio | No | Record 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 | |
| scrollDirection | No | If not found, scroll this way and look again (lists load lazily, so off-screen rows may not exist yet) |