# simulator_input

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

Source: https://air.build/docs/mcp-tools/simulator_input/

`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](https://air.build/docs/mcp-tools/simulator_batch/). Points use [screen coordinates](https://air.build/docs/mcp-tools/simulator_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](https://air.build/docs/mcp-tools/simulator_tap/) with coordinates |
| `swipe` | `startX`, `startY`, `endX`, `endY`; `duration` (optional) | As [simulator_swipe](https://air.build/docs/mcp-tools/simulator_swipe/) |
| `type` | `text` | As [simulator_type_text](https://air.build/docs/mcp-tools/simulator_type_text/) |
| `key` | `code`; `modifiers`, `duration` (optional) | As [simulator_key](https://air.build/docs/mcp-tools/simulator_key/) |
| `button` | `button`; `duration` (optional) | As [simulator_button](https://air.build/docs/mcp-tools/simulator_button/) |
| `orientation` | `orientation` | As [simulator_rotate](https://air.build/docs/mcp-tools/simulator_rotate/) |
| `fold` | `degrees` (0 to 180) | Moves a foldable's hinge, as [simulator_fold](https://air.build/docs/mcp-tools/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](https://air.build/docs/mcp-tools/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](https://air.build/docs/mcp-tools/list_teams/) |
| `simulator` | string | No | The Team's default device | Which device, by `id` from [list_simulators](https://air.build/docs/mcp-tools/list_simulators/#result) |
| `event` | object with a `type` | Yes | — | The [event](https://air.build/docs/mcp-tools/simulator_input/#events) |

## Result

| Field | What |
| --- | --- |
| `ok` | `true` |

```json
{ "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](https://air.build/docs/mcp-tools/start_simulator/#device-errors).

## Example

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

```json
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-down", "x": 2, "y": 400, "edge": "left"}}}
```

```json
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-move", "x": 200, "y": 400, "edge": "left"}}}
```

```json
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-up", "x": 300, "y": 400, "edge": "left"}}}
```
