MCP tools

The MCP tool that sends one raw input event to the Team's Simulator, for gestures the other input tools do not cover.

simulator_input sends one raw input event to the Team’s running Simulator. Use it for what the other tools do not do: a touch held down across several calls, a two-finger pinch, or a swipe in from a screen edge. A whole gesture is several events (down, one or more moves, up), so send them in order, or together as input steps of simulator_batch. Points use screen coordinates and are not checked against elements. For everyday taps, swipes, typing and buttons, prefer the tools made for them.

Read-only Destructive Idempotent
No No No

Events

event is an object with a type and that type’s fields:

type Fields What it does
touch1-down, touch1-move, touch1-up, touch1-cancel x, y; edge (optional) One finger: put down, move, lift, or cancel. edge (e.g. left, bottom) makes it a swipe in from that edge of the screen
touch2-down, touch2-move, touch2-up, touch2-cancel x1, y1, x2, y2 Two fingers at once, for a pinch or a two-finger rotate
tap x, y; duration (optional) A tap, as simulator_tap with coordinates
swipe startX, startY, endX, endY; duration (optional) As simulator_swipe
type text As simulator_type_text
key code; modifiers, duration (optional) As simulator_key
button button; duration (optional) As simulator_button
orientation orientation As simulator_rotate
fold degrees (0 to 180) Moves a foldable’s hinge, as simulator_fold

Every pointer event (touch1-*, touch2-*, tap, swipe) also takes optional width and height: send them to give coordinates in a frame of that size instead of the device’s screen, and they are scaled to fit. Any event may carry display, a display’s screenId from simulator_displays, to address one display of a foldable.

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
event object with a type Yes — The event

Result

Field What
ok true
{ "ok": true }

Errors

Message When What to do
event is an object with a “type”. event is missing, not an object, or has no type Send an object with a type
Failed to deserialize the JSON body into the target type: … An unknown type, a missing field, or a field of the wrong type Fix the field the message names

Plus the errors every Simulator tool can return: see start_simulator.

Example

A swipe in from the left edge (Back), as three calls:

{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-down", "x": 2, "y": 400, "edge": "left"}}}
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-move", "x": 200, "y": 400, "edge": "left"}}}
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-up", "x": 300, "y": 400, "edge": "left"}}}