Skip to main content
Glama

trim_media

Cut a segment from a video or audio file using stream copy by default, or re-encode for accurate cuts.

Instructions

Cut a segment from a video or audio file. Uses stream copy without re-encoding by default, or re-encodes when accurate cuts are needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endTimeNoOptional end timestamp formatted as 'HH:MM:SS' or seconds. Do not combine with duration.
durationNoOptional duration in seconds from startTime (e.g. '30'). If neither endTime nor duration is set, trims to end of file.
inputPathYesPath to the source media file to cut.
startTimeYesStart timestamp formatted as 'HH:MM:SS' (e.g. '00:01:30') or seconds (e.g. '90').
outputPathYesDestination path for the trimmed output file (e.g. './clip.mp4').
accurateReencodeNoRe-encode video for cuts between keyframes. Default: false (uses fast stream copy).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.4.2
    • changedInput schema / properties / accurateReencode / description
      Previous value: -"If true, re-encodes video for frame-accurate cuts. If false (default), uses instantaneous lossless stream copy."New value: +"Re-encode video for cuts between keyframes. Default: false (uses fast stream copy)."
    • changedInput schema / properties / duration / description
      Previous value: -"Duration to cut from startTime, e.g. '30' (seconds)"New value: +"Optional duration in seconds from startTime (e.g. '30'). If neither endTime nor duration is set, trims to end of file."
    • changedInput schema / properties / endTime / description
      Previous value: -"End time timestamp, e.g. '00:02:15' or '135'"New value: +"Optional end timestamp formatted as 'HH:MM:SS' or seconds. Do not combine with duration."
    • changedInput schema / properties / inputPath / description
      Previous value: -"Path to the input media file"New value: +"Path to the source media file to cut."
    • changedInput schema / properties / outputPath / description
      Previous value: -"Destination file path for the trimmed clip"New value: +"Destination path for the trimmed output file (e.g. './clip.mp4')."
    • changedInput schema / properties / startTime / description
      Previous value: -"Start time timestamp, e.g. '00:01:30' or '90' (in seconds)"New value: +"Start timestamp formatted as 'HH:MM:SS' (e.g. '00:01:30') or seconds (e.g. '90')."
  2. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose a genuinely useful behavioral trait — default stream copy (fast, keyframe-boundary cuts) versus re-encoding for accuracy — which an agent could not infer from the schema alone. But it omits important behaviors for a file-writing tool: whether outputPath is overwritten if it already exists, what happens on invalid timestamps, and whether the original file is left untouched.

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?

Two sentences with zero filler, and the core purpose is front-loaded before the behavioral caveat. Every clause earns its place.

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

Completeness3/5

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

There is no output schema and no annotations, so the description has to cover more ground than it does. It is adequate for understanding what the tool does, but a mutation tool that writes a new file should say whether the result overwrites, what it returns, and how failures surface.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already explains startTime, endTime, duration, inputPath, outputPath and accurateReencode in detail, including the endTime/duration mutual exclusion. The description adds only a light rationale for accurateReencode, so the baseline of 3 is appropriate.

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: 'Cut a segment from a video or audio file.' An agent immediately knows the operation. However, it never distinguishes this from near-neighbors like trim_silence or extract_audio, so the reader must infer scope from the name alone.

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

Usage Guidelines3/5

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

Usage is implied by the operation itself, and the stream-copy vs. re-encode note hints at the speed/accuracy tradeoff that drives the accurateReencode choice. But there is no explicit when-to-use guidance, no mention of alternatives such as trim_silence for silence removal, and no prerequisites or limits stated.

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