MCP tools

The MCP tool that taps or long-presses the Team's Simulator's screen, at a point or on an element named by a selector.

simulator_tap taps the Team’s running Simulator’s screen, in one of two ways. Give exactly one:

  • Coordinates: x and y, in screen coordinates. The tap goes there at once, whatever is under it.
  • An element: a selector, any of text, id, value, role and nodeId from simulator_describe_ui or simulator_find (see Selectors). The tool waits, up to timeoutSeconds, for a matching element that is enabled and holds still, then taps it (its center, or the point iOS gives for controls like switches). It does not scroll: bring the element on screen first with simulator_scroll_to.

duration holds the finger down: a long press. The tool does not check what the tap did; look with simulator_describe_ui or wait for the result with simulator_wait.

Read-only Destructive Idempotent
No No No

Inputs

Input Type Required Default What it does
teamId string (UUID) Yes — The Team, from list_teams
simulator string No The Team’s default device Which device, by id from list_simulators
x number, -100000 to 100000 With y — Where to tap, across
y number, -100000 to 100000 With x — Where to tap, down
text, id, value, role, nodeId, exact, strict see Selectors Instead of x, y — The element to tap
duration number, 0 to 60 No A plain tap Seconds to hold: a long press
timeoutSeconds number, 0 to 600 No 10 With a selector: how long to wait for the element
display string No The display in use With coordinates, on a foldable: the display’s screenId from simulator_displays

Result

With coordinates:

Field What
ok true

With a selector:

Field What
ok true
element The element tapped (fields as in simulator_find)
point x, y: where the tap landed
exact Whether its text equals the query
matchCount How many usable elements matched; more than 1 means the ranking chose
excluded Elements that matched but were left out, with reason
elapsedMs When the wait took more than one round: how long it waited, in milliseconds
{
  "ok": true,
  "element": { "label": "New note", "identifier": "new-note", "role": "AXButton",
               "frame": { "x": 16, "y": 120, "width": 370, "height": 52 }, "enabled": true, "interactive": true, "adjustable": false },
  "point": { "x": 201, "y": 146 },
  "exact": true,
  "matchCount": 1,
  "excluded": []
}

Errors

Message When What to do
Give both x and y. Only one coordinate Send both
Give coordinates or a selector, not both. Coordinates and selector fields together Send one or the other
Name the element: text, id, value, role or nodeId. Neither coordinates nor a selector Send one
no usable element matching selector within ns Nothing usable matched in time See selector errors

Plus the other selector errors, and the errors every Simulator tool can return: see start_simulator.

Example

{"name": "simulator_tap", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "id": "new-note"}}