Skip to main content
Glama

Set clip duration

set_clip_duration

Change a clip's timeline length to an exact duration by moving only its end, with optional ripple editing to shift later clips and keep tracks in sync.

Instructions

Make a clip exactly duration seconds long by moving its end (the start and source in point stay; speed does not change). ripple=false (default) leaves a gap when shortening and stops at the next clip when lengthening. With ripple=true everything that starts at or after the clip's old end, on all tracks, shifts by the change so the sequence stays in sync (a track where that would make clips collide is left alone and listed in tracks_not_rippled). Video and audio cannot grow past the end of their source media (stills can): the result reports the real duration. include_linked (default true) applies the same to the linked audio/video clips. For many clips use set_clips_duration. Returns the clip.

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": {
      "duration": "<duration>"
    },
    "name": "set_clip_duration"
  }
}

Input Schema

NameRequiredDescriptionDefault
rippleNoShift all later clips on every track by the change. Default false.
clip_idNoStable clip id (from get_sequence_structure / list_clips). Preferred.
durationYesNew length of the clip on the timeline, in seconds. Snapped to a frame.
clip_indexNo0-based index of the clip in its track's clip list, as reported by list_clips / get_sequence_structure. Usually time order, but a moved clip can keep its old index, and indices shift after edits: prefer clip_id.
track_typeNoUsed with track_index + clip_index when clip_id is not given. Default "video".
sequence_idNoStable sequence id (from list_sequences). Omit to use the active sequence.
track_indexNo0-based track index (0 = V1 or A1).
sequence_nameNoSequence name; used only when sequence_id is not given.
include_linkedNoAlso resize the clips linked to this one (the audio of a video clip, or the video of an audio clip). Default true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare the operation is non-read-only but non-destructive; the description goes well beyond that by disclosing the gap-versus-sync tradeoff, the all-tracks scope of ripple, the collision fallback, and the media-source ceiling on growth ('Video and audio cannot grow past the end of their source media (stills can)'). It also states the side effect on linked clips and that the result reports the real, possibly clamped, duration.

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?

Front-loaded with the core action and its invariants, then defaults and edge cases in descending priority; nearly every clause carries information. It is a dense single paragraph, though, and the parenthetical asides make it heavier to scan than a short bulleted structure would.

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?

With nine parameters, no output schema, and a mutation that shifts other clips, the description covers what changes, what stays fixed, what happens to neighbors, what the return contains ('Returns the clip'), and where the real duration surfaces. Nothing an agent needs to call this correctly and predict its effects is missing.

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 adds real meaning on top by explaining the operational consequence of ripple=true (everything starting at or after the clip's old end, on all tracks, shifts) and of include_linked (the linked audio/video is resized the same way). It does not add anything about the clip_id vs clip_index selection tradeoff that the schema already covers.

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 precise verb and resource: 'Make a clip exactly duration seconds long by moving its end,' and immediately fixes the invariants (start and source in point stay; speed does not change). It also names the sibling it is not, 'For many clips use set_clips_duration,' so an agent can distinguish it from the batch variant without opening a schema.

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?

Explicitly routes the agent to set_clips_duration for many clips and spells out the ripple=false vs ripple=true decision with the default stated for each. It also explains what ripple does when it cannot be applied ('a track where that would make clips collide is left alone and listed in tracks_not_rippled'), which is the kind of edge case an agent would otherwise discover only after a bad call.

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