Set Clip Duration
set_clip_durationSet a timeline clip's visible duration by moving only its end while keeping the start fixed, including extending still images, with overlap and keyframe safeguards.
Instructions
Set one timeline clip's visible duration by moving only its timeline end (TrackItem.end) while keeping its start fixed. Pass exactly one of duration_seconds or end_seconds. Works for extending still images past their import length. Refuses to overlap the next clip on the same track, rejects shortening that would strand effect keyframes unless keyframe_policy is preserve, reads start/end back, and restores the original end if Premiere clamps or ignores the write (for example when video media has no handle left). Linked audio/video partners get the same change by default (include_linked), applied as the same end offset so partners with a J/L cut keep their offset; every clip is checked before any is changed. Use this instead of speed changes, which Premiere does not expose to scripting. Existing host Out padding below one sequence frame may be preserved or reduced, but never used to create additional padding. Non-still sources require readable ffprobe duration evidence and a readable sequence frame grid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | Node ID of the timeline clip (track item) to resize | |
| end_seconds | No | Target absolute timeline end (out-point) in seconds. Must be at least one frame after the clip's start. Specify exactly one of duration_seconds or end_seconds. | |
| include_linked | No | Also apply the edit to the clip's linked audio/video partners, as Premiere does with linked selection (default: true). | |
| 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 | When shortening, how to handle effect keyframes beyond the new visible length: reject (default) leaves the timeline unchanged; preserve keeps them and reports their count. | |
| duration_seconds | No | Target visible duration in seconds, measured from the clip's current timeline start. Specify exactly one of duration_seconds or end_seconds. | |
| 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. |