Skip to main content
Glama

Trim Clip

trim_clip

Trims exactly one clip source in or out point and verifies the visible timeline edge; linked audio/video stays in sync, and unsafe edits are refused before mutation.

Instructions

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

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": "trim_clip"
  }
}

Input Schema

NameRequiredDescriptionDefault
node_idYesNode ID of the clip to trim
include_linkedNoAlso apply the edit to the clip's linked audio/video partners, as Premiere does with linked selection (default: true).
new_in_secondsNoNew source in-point in seconds (relative to the clip's source media). Specify exactly one edit point.
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_policyNoHow 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_secondsNoNew source out-point in seconds (relative to the clip's source media). Specify exactly one edit point.
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.8/5.0
Behavior5/5

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

Far beyond the annotations (which only say readOnly=false, destructive=false, openWorld=false, idempotent=false), the description discloses the all-or-nothing check semantics ("every clip is checked before any is changed"), the linked-partner synchronization rule (same offset from each partner's own source point, preserving J/L cuts), and default keyframe refusal plus the padding rule. These are exactly the mutation-safety facts an agent cannot infer from the structured fields.

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?

A single dense paragraph with almost no filler, but it leads with refusal conditions and pushes the core action ("Trim exactly one source in/out point") into the second clause, which costs some front-loading. The long linked-partner sentence is information-rich but would scan better as separate statements.

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 destructive-adjacent mutation with 8 parameters, nested CEP guards, and an output schema, the description covers the failure modes, atomicity, linked-partner semantics, keyframe policy, and sibling alternatives. Return values are handled by the output schema, so nothing an agent needs before calling 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 genuinely new meaning by stating "Specify exactly one edit point" — a mutual-exclusion constraint the schema does not encode — and by explaining include_linked's offset semantics and keyframe_policy's default reject behavior in consequence terms rather than enum labels. It does not add guidance for idempotency_key or expected_cep_target beyond their (already extensive) schema text.

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?

The description states a precise verb and scope: "Trim exactly one source in/out point and verify the corresponding visible timeline edge." It also explicitly distinguishes itself from set_clip_duration (timeline length / still-image extension) and remove_transition (transition cleanup), so an agent can place it among siblings without opening either 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?

It names concrete preconditions and exclusions: transitions attached or unreadable, retimed clips, extensions overlapping the neighbouring clip, unknown media duration, and keyframes outside the visible range. It also routes the agent to a specific alternative ("use remove_transition first", "use set_clip_duration") for each case where this tool is the wrong choice.

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