Trim Clip
trim_clipTrims one clip's source in or out point, verifies the visible timeline edge, and keeps linked audio/video in sync by default while refusing unsafe edits before changing anything.
Instructions
Trim exactly one source in/out point and verify the corresponding visible timeline edge. Requires accessible physical media duration from ffprobe; unknown duration or linked partners using different source files refuse before mutation. Refuses retimed clips, extensions that would overlap the neighbouring clip on the same track, and, by default, trims that would leave effect keyframes outside the visible clip. Linked audio/video partners get the same trim by default (include_linked), applied as the same offset from each partner's own source point so a J/L cut or slipped audio stays in sync; every clip is checked before any is changed. To set a clip's timeline length or extend a still image, use set_clip_duration. Existing host Out padding below one sequence frame may be preserved or reduced, but never used to create additional padding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | Node ID of the clip to trim | |
| include_linked | No | Also apply the edit to the clip's linked audio/video partners, as Premiere does with linked selection (default: true). | |
| new_in_seconds | No | New source in-point in seconds (relative to the clip's source media). Specify exactly one edit point. | |
| idempotency_key | No | Optional client-chosen key (1-128 chars of A-Z a-z 0-9 . _ : -) for this intended edit. Pass a fresh key per edit and reuse it only when retrying that same edit, for example after a client-side timeout. A repeat with the same tool, key and arguments is not run again: while the first call is running it fails with IDEMPOTENCY_IN_PROGRESS (poll get_last_operations); after it finished it returns the original outcome marked replayed. A definite failure with nothing applied (receipt outcome not_applied) may be retried with the same key. Reusing a key with different arguments fails with IDEMPOTENCY_KEY_REUSED. Scoped to this MCP session (the stdio server process or one HTTP session) and held in memory only (200 keys, 1 hour); it does not survive a restart or reconnect. Read-only invocations are never deduplicated. | |
| keyframe_policy | No | How to handle effect keyframes beyond the trimmed visible range: reject (default) leaves the timeline unchanged; preserve explicitly keeps them and reports their count; hold_last_value keeps them too but makes every animated numeric parameter hold the value it had at the edge. Trimming into an animation adds a key at the new edge with the value sampled there before the trim; extending past keyframes adds keys at the old and new edge with the old edge's value so the revealed range stays flat. It refuses before mutation if keyframes would be revealed, a value cannot be sampled, or a non-numeric/colour parameter would need a key. Each parameter is read back at the new edge; key writes that do not verify report committed_unverified. | |
| new_out_seconds | No | New source out-point in seconds (relative to the clip's source media). Specify exactly one edit point. | |
| expected_cep_target | No | Optional reviewed CEP sequence/clip identity and exact tick ranges. Checked before every generated command; UXP refuses this CEP-only guard. | |
| expected_project_path | No | Optional absolute saved-project path. Every generated CEP command refuses before its body when the active project differs or is unsaved. UXP commands refuse this CEP-only guard; local-only tools do not inspect Premiere. Omit to keep existing behavior. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool completed successfully. | |
| data | No | Tool-specific result data when ok is true; on failure, diagnostic detail when the tool provides it. | |
| tool | Yes | The registered MCP tool name. | |
| error | No | Failure detail when ok is false. | |
| receipt | No | Versioned common mutation receipt; success never implies rendered verification. | |
| idempotency | No | Present when idempotency_key deduplicated this call: replayed is true when the original outcome was returned instead of running again. |