Skip to content

MCP: edit operations

clip.add_composition

Places another timeline of the project on a track as one clip.

Last updated:

Adds a composition: the timeline named by timeline_id, used as a clip (RF-083). Nothing is copied, so changing that timeline changes every composition that uses it. The default duration is the rest of the nested timeline from source_in. A timeline cannot contain itself at any depth, and compositions nest at most 4 deep.

Arguments#

ArgumentTypeRequiredNotes
durationstringnoA length; default the rest of the nested timeline from source_in.
fitcover, contain, noneno
idstringnopattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
source_instringnoWhere in the nested timeline to start, as a length from its start; default 0s.
startstringnoAbsolute position; omitted, the end of the last item of the track (0s on an empty track).
timeline_idstringyesAnother timeline of the same project.; pattern ^prj_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
track_idstringyesA visual track.; pattern ^trk_[0123456789abcdefghjkmnpqrstvwxyz]{10}$

Errors#

Scope#

Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help clip.add_composition 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": "clip.add_composition",
          "args": {
            "id": "itm_m1n2p3q4r5",
            "start": "0s",
            "timeline_id": "prj_a1b2c3d4e5",
            "track_id": "trk_f6g7h8j9k0"
          }
        }
      ]
    }
  }
}

As a batch file for the CLI

batch.json
[
  {
    "op": "clip.add_composition",
    "args": {
      "id": "itm_m1n2p3q4r5",
      "start": "0s",
      "timeline_id": "prj_a1b2c3d4e5",
      "track_id": "trk_f6g7h8j9k0"
    }
  }
]
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": "clip.add_composition",
      "args": {
        "id": "itm_m1n2p3q4r5",
        "start": "0s",
        "timeline_id": "prj_a1b2c3d4e5",
        "track_id": "trk_f6g7h8j9k0"
      }
    }
  ]
}'

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