Skip to main content
Glama

Trim clip

trim_clip
Destructive

Changes a clip's timeline start/end frames, adjusting source in/out like resizing in Kdenlive without rippling or overwriting; writes edited project to a destination file.

Instructions

Change a clip's timeline bounds to [start, end) (either may be omitted); the source in/out points follow, like resizing in Kdenlive. Extending is limited by the source length. Positions are frames at the project rate; nothing ripples and nothing is overwritten (overlaps fail). A clip grouped with its audio/video counterpart is edited together with it. The result is written to destination with the save_project_copy rules.

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": {
      "path": "<path>",
      "clip": "<clip>",
      "revision": "<revision>",
      "destination": "<destination>"
    },
    "name": "trim_clip"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNo
clipYesClip ref from get_timeline, '<track>@<start>' (e.g. 'V1@90'). It changes when the clip moves: read the timeline again after an edit.
pathYesAbsolute path of a .kdenlive project file on this machine.
startNo
revisionYessha256 of the project file (file.sha256 from get_timeline) that the clip ref comes from; the edit is refused if the file changed since.
sequenceNoSequence uuid or name; default: active sequence.
overwriteNoAllow replacing an existing destination file.
destinationYesAbsolute path of the .kdenlive file to write (the source by default is never modified; see save_project_copy for the overwrite rules).
expected_sha256NoRequired to write over the source: its sha256 as last read. Tools that take `revision` use it when this is omitted.

Output Schema

NameRequiredDescriptionDefault
audioNo
mediaNo
savedYes
titleNo
trackNo
relinkNo
effectsNo
markersNo
timelineNo
subtitlesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=false; the description adds real value beyond them by disclosing that nothing ripples, overlaps fail, extension is bounded by source length, the source file is never modified, and output goes to `destination` under save_project_copy rules. The grouped-clip side effect is exactly the kind of hidden behavior an agent needs.

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

Conciseness5/5

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

A single dense paragraph that front-loads the core operation, then bounds, then side effects, then the write target. Every sentence carries distinct information; nothing repeats the schema or annotations.

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 9-parameter mutating tool with an output schema and annotations present, the description covers semantics, limits, side effects, and destination handling. Return values need not be explained since an output schema exists, and remaining parameters (revision, sequence, overwrite, expected_sha256) are handled in the schema itself.

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 78%, so most parameters are already documented. The description still adds meaning beyond the schema by defining the half-open interval, noting that either bound may be omitted, and specifying that positions are frames at the project rate — semantics the schema's bare integer types do not convey.

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 ('Change a clip's timeline bounds') plus the precise target interval '[start, end)' and the analogy 'like resizing in Kdenlive'. An agent can distinguish this from move_clip or split_clip without opening the schema.

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

Usage Guidelines4/5

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

Gives clear operating context: either bound may be omitted, extending is capped by source length, and grouped audio/video clips are edited together. It implies the 'no ripple' semantics that separate it from a ripple edit, but never names a sibling tool or states an explicit when-not-to-use condition.

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