# recording.auto_zoom

> Zooms a screen take on its clicks.

Source: https://stuarty.com/docs/mcp/tools/edit/recording.auto_zoom/

Plans zooms from the clicks of the recording of the clip's asset and writes them as keyframes of x, y and scale of the clip, in one undoable step; any x, y and scale keyframes the clip already has are replaced. Clicks close in time and in space make one zoom, the view eases in before the first click, is held after the last one and eases out; zooms that would rest for under a second between them become a pan. The level is at most 3x and a zoom is held at least 0.5 s, so the defaults are gentle. The picture never leaves the frame. The clicks come from the pointer events of the recording and are supplied by the service in resolved; the command never starts a capture. The same clicks and options always give the same keyframes. The clip must play at a constant speed, forward, and be neither cropped, rotated nor flipped. Run recording.set_cursor and recording.set_click_highlight again after changing the zoom by hand.

## Arguments

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `hold_ms` | `integer` | no | The least time a zoom is held after its last click, 500 to 10000 ms. Default 1200.; min 500; max 10000 |
| `item_id` | `string` | yes | A clip of a screen recording.; pattern `^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$` |
| `lead_ms` | `integer` | no | The full zoom is reached this long before the first click, 0 to 3000 ms. Default 400.; min 0; max 3000 |
| `level` | `number` | no | How far the view zooms in, 1.1 to 3. Default 1.6.; min 1.1; max 3 |
| `max_zooms` | `integer` | no | The most zooms made, the first in time, 1 to 24. Default 24.; min 1; max 24 |
| `merge_ms` | `integer` | no | Clicks closer than this, in one window, make one zoom, 0 to 10000 ms. Default 2500.; min 0; max 10000 |
| `ramp_ms` | `integer` | no | The length of the ease in and of the ease out, 200 to 3000 ms. Default 700.; min 200; max 3000 |

## Errors

- [`E_VALIDATION`](/docs/reference/error-codes#e_validation)
- [`E_NOT_FOUND`](/docs/reference/error-codes#e_not_found)
- [`E_TYPE_MISMATCH`](/docs/reference/error-codes#e_type_mismatch)
- [`E_INVALID_STATE`](/docs/reference/error-codes#e_invalid_state)

## Scope

Scope `edit`. The scope is the one an API key needs in network mode. Run `stuarty command:help recording.auto_zoom` for the same description from the binary, or call the [`command_help`](/docs/mcp/tools/command_help) tool.

## Next steps

- [The edit tool](/docs/mcp/tools/edit)
- [Batches, revisions and idempotency](/docs/agents/batches)

**As an MCP call**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "edit",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "base_revision": 12,
      "operations": [
        {
          "op": "recording.auto_zoom",
          "args": {
            "item_id": "itm_m1n2p3q4r5",
            "level": 1.8
          }
        }
      ]
    }
  }
}
```

**As a batch file for the CLI**

```json
[
  {
    "op": "recording.auto_zoom",
    "args": {
      "item_id": "itm_m1n2p3q4r5",
      "level": 1.8
    }
  }
]
```

```bash
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json
```

**Over HTTP**

```bash
curl -X POST "http://127.0.0.1:7878/api/v1/projects/prj_7k2m9x4q1b/edit" \
  -H "Authorization: Bearer $STUARTY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "base_revision": 12,
  "operations": [
    {
      "op": "recording.auto_zoom",
      "args": {
        "item_id": "itm_m1n2p3q4r5",
        "level": 1.8
      }
    }
  ]
}'
```

The ids in the example are illustrative: read the real ones with `project_get`.
