Skip to main content
Glama

Set Clip Duration

set_clip_duration

Sets one timeline clip’s visible duration by moving its end point while keeping its start fixed, with optional linked audio/video changes and safety checks against overlaps or stranded keyframes.

Instructions

Refuses attached transitions or unreadable transition collections before structural edits; inspect transitionsAffected and use remove_transition first. 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "node_id": "<node_id>"
    },
    "name": "set_clip_duration"
  }
}

Input Schema

NameRequiredDescriptionDefault
node_idYesNode ID of the timeline clip (track item) to resize
end_secondsNoTarget 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_linkedNoAlso apply the edit to the clip's linked audio/video partners, as Premiere does with linked selection (default: true).
idempotency_keyNoOptional 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 the HTTP server process when Streamable HTTP is stateless per request) and held in memory only (200 keys, 1 hour); it does not survive a restart or reconnect. Read-only invocations are never deduplicated.
keyframe_policyNoWhen 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_secondsNoTarget visible duration in seconds, measured from the clip's current timeline start. Specify exactly one of duration_seconds or end_seconds.
expected_cep_targetNoOptional reviewed CEP sequence/clip identity and exact tick ranges. Checked before every generated command; UXP refuses this CEP-only guard.
expected_project_pathNoOptional 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

NameRequiredDescriptionDefault
okYesWhether the tool completed successfully.
dataNoTool-specific result data when ok is true; on failure, diagnostic detail when the tool provides it.
toolYesThe registered MCP tool name.
errorNoFailure detail when ok is false.
receiptNoVersioned common mutation receipt; success never implies rendered verification.
idempotencyNoPresent when idempotency_key deduplicated this call: replayed is true when the original outcome was returned instead of running again.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.30.0

TDQS

A4.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations, disclosing refusal conditions, pre-flight checking of every clip before any change, read-back of start/end, and restoring the original end when Premiere clamps or ignores the write. The annotations (destructiveHint=false, idempotentHint=false) are consistent with the described rollback behavior, so no contradiction. It does not, however, note that idempotentHint=false coexists with the idempotency_key parameter's replay semantics, leaving that interaction for the schema to explain.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every clause carries operational information, but the description opens with a refusal about transitions rather than the tool's purpose, and the semicolon-chained sentences make it dense. It is efficient for its size but not optimally front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with nested guard objects and an output schema, the description covers preconditions, partial-failure semantics, linked-partner behavior, media edge cases (stills extended past import length, video with no handle left), and padding constraints. An agent has enough to call it correctly and predict failure modes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above baseline by explaining genuinely new semantics — linked partners receive the same end offset so J/L cuts keep their offset, keyframe_policy gates shortening, and duration_seconds vs end_seconds is mutually exclusive. It still leaves the idempotency and expected_* guard parameters entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'Set one timeline clip's visible duration by moving only its timeline end (TrackItem.end) while keeping its start fixed' — which distinguishes it from set_clip_start_time and set_clip_speed_qe. The mechanism (move end, hold start) is named explicitly so the agent knows exactly what edit is performed.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit preconditions and routing: 'Refuses attached transitions ... use remove_transition first', 'Pass exactly one of duration_seconds or end_seconds', and 'Use this instead of speed changes, which Premiere does not expose to scripting'. It also names when-not conditions (overlap with next clip, stranding keyframes unless keyframe_policy=preserve).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools