Skip to content

MCP: edit operations

recording.apply_layout

Frames a screen and a webcam clip in a layout.

Last updated:

Places a screen clip and, for every layout but screen_only, a webcam clip by a named layout made for the project format (16:9, 1:1, 4:5 or 9:16): screen_only, pip (the camera over a corner of the screen, a circle by default), split (side by side in 16:9, one above the other in the others) or camera_focus (the camera fills the frame, the screen is a small inset). padding is a fraction of the shorter side of the frame, 0 to 0.25, left empty around everything. The result is ordinary fit, position, scale, crop and mask values, so every one stays editable, and no clip leaves the frame. The clip in front is put on the upper track. A clip whose x, y, scale, rotation or crop has keyframes cannot be laid out: apply the layout before recording.auto_zoom.

Arguments#

ArgumentTypeRequiredNotes
camera_item_idstringnoThe clip of the webcam take; required by every layout but screen_only, which refuses it.; pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
camera_shapecircle, rectnoFor pip. circle (default) or rect.
cornertop_left, top_right, bottom_left, bottom_rightnoFor pip and camera_focus. Default bottom_right.
layoutscreen_only, pip, split, camera_focusyesScreen_only, pip, split or camera_focus.
paddingnumbernoFraction of the shorter side of the frame left empty around everything, 0 to 0.25. Default 0.; min 0; max 0.25
screen_item_idstringyesThe clip of the screen take.; pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$

Errors#

Scope#

Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help recording.apply_layout for the same description from the binary, or call the command_help tool.

Next steps#

As an MCP call

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "edit",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "base_revision": 12,
      "operations": [
        {
          "op": "recording.apply_layout",
          "args": {
            "camera_item_id": "itm_s6t7v8w9x0",
            "corner": "bottom_left",
            "layout": "pip",
            "screen_item_id": "itm_m1n2p3q4r5"
          }
        }
      ]
    }
  }
}

As a batch file for the CLI

batch.json
[
  {
    "op": "recording.apply_layout",
    "args": {
      "camera_item_id": "itm_s6t7v8w9x0",
      "corner": "bottom_left",
      "layout": "pip",
      "screen_item_id": "itm_m1n2p3q4r5"
    }
  }
]
Terminal
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json

Over HTTP

curl
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.apply_layout",
      "args": {
        "camera_item_id": "itm_s6t7v8w9x0",
        "corner": "bottom_left",
        "layout": "pip",
        "screen_item_id": "itm_m1n2p3q4r5"
      }
    }
  ]
}'

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