Skip to content

MCP: edit operations

keyframe.set

Adds or replaces a keyframe of one animated property of an item.

Last updated:

Sets the value of x, y, scale, rotation, opacity, (clips and audio) volume, (clips) brightness, contrast, saturation, temperature, tint or hue, (items with a mask, set it first with clip.set_mask) mask_x, mask_y, mask_width, mask_height or mask_feather, or (clips) crop_left, crop_top, crop_right or crop_bottom at an absolute position inside the item, from its start to its end inclusive. When the property had no keyframe and at is after the start, its current static value becomes the first keyframe. The easing applies from this keyframe to the next. At most 100 keyframes per property.

Arguments#

ArgumentTypeRequiredNotes
atstringyesPosition on the project timeline, from the item start to its end inclusive.
bezierarray of numbernoX1, y1, x2, y2 of the curve of easing bezier: x1 and x2 from 0 to 1, y1 and y2 from -2 to 3.; at least 4 items; at most 4 items
easinglinear, ease_in, ease_out, ease_in_out, hold, beziernoFrom this keyframe to the next. Default linear. bezier needs the bezier argument.
item_idstringyespattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
propertystring, one of 21 valuesyes
valuenumberyesValid for the property: scale above 0 up to 20, opacity 0 to 1, volume 0 to 4.

Errors#

Scope#

Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help keyframe.set 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": "keyframe.set",
          "args": {
            "at": "2s",
            "easing": "ease_out",
            "item_id": "itm_s6t7v8w9x0",
            "property": "scale",
            "value": 1.2
          }
        }
      ]
    }
  }
}

As a batch file for the CLI

batch.json
[
  {
    "op": "keyframe.set",
    "args": {
      "at": "2s",
      "easing": "ease_out",
      "item_id": "itm_s6t7v8w9x0",
      "property": "scale",
      "value": 1.2
    }
  }
]
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": "keyframe.set",
      "args": {
        "at": "2s",
        "easing": "ease_out",
        "item_id": "itm_s6t7v8w9x0",
        "property": "scale",
        "value": 1.2
      }
    }
  ]
}'

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