Skip to main content
Glama

video_trim

Cut a segment from a longer video by specifying start time and duration or end time, then save the resulting clip to an output path.

Instructions

Trim a video clip by start time and duration. Returns JSON {success, output_path} pointing at the rendered clip. Use to cut a segment out of a longer video. Pass input_path as the absolute path to the source video (e.g. from video_info), start as a timestamp, and duration or end to define the segment.

Args: input_path: Absolute path to the input video. start: Start timestamp (e.g. '00:02:15') or numeric seconds (e.g. 10.5). duration: Duration to keep (e.g. '00:00:30' or '30'). Exclusive with end. end: End timestamp. Exclusive with duration. output_path: Where to save the trimmed video. Auto-generated if omitted. accurate: Frame-accurate seeking (slower). Default False uses fast input seeking which may land on the nearest keyframe.

Input Schema

NameRequiredDescriptionDefault
endNo
startNo0
accurateNo
durationNo
overwriteNoExplicitly allow replacing existing media. Existing non-media files are protected.
input_pathYes
output_pathNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.16.4
    • addedInput schema / properties / overwrite
      Added value: +{
      +  "default": false,
      +  "description": "Explicitly allow replacing existing media. Existing non-media files are protected.",
      +  "title": "Overwrite",
      +  "type": "boolean"
      +}
  2. Changed5 schema fields changedv1.16.0
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / duration / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / end / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / start / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  }
      +]
    • removedInput schema / properties / start / type
      Removed value: -"string"
  3. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / accurate
      Added value: +{
      +  "default": false,
      +  "title": "Accurate",
      +  "type": "boolean"
      +}
  4. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations the description carries the full burden, and it delivers real behavioral detail: the return shape {success, output_path}, auto-generated output paths, and the important caveat that accurate=False uses fast input seeking and 'may land on the nearest keyframe'. It omits overwrite/error behavior, but the overwrite parameter is at least documented in the schema.

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?

Purpose and return value are front-loaded in the first two sentences, followed by practical guidance, with the Args block last. The Args block repeats some parameter names already visible in the schema, adding modest redundancy but earning its place through format examples.

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

Completeness4/5

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

For a 7-parameter tool with 14% schema coverage, the description fills nearly all the semantic gaps an agent needs: timestamp formats, exclusivity, output path defaults, and the accuracy/speed tradeoff. Output schema exists so return-value detail is not strictly required, and the overwrite guard is covered by the schema.

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 only 14%, so the description must compensate, and it largely does: it documents input_path (absolute path), start (timestamp or numeric seconds), duration, end, output_path (auto-generated if omitted), and accurate (slower, keyframe caveat). Only overwrite is left to the schema, which does describe it adequately.

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

Purpose4/5

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

States a specific verb and resource ('Trim a video clip') plus the scope of the result ('cut a segment out of a longer video'), which is enough to place it apart from merge, split_screen, or crop siblings. It does not name any specific sibling it competes with (e.g. video_edit, video_export_frames), so it stops short of the top score.

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 a clear operating context ('Use to cut a segment out of a longer video') and a prerequisite chain by pointing at video_info for the input path. It also flags the duration-vs-end mutual exclusivity, which prevents a common wrong call. No explicit when-not-use guidance or named alternative tool.

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