Skip to main content
Glama

Trim a video

trim_video

Save one stretch of an owned video as a new clip, using a keyframe copy by default. Set accurate true to re-encode an exact window for seamless adjacent cuts. Specify the start time and duration in seconds. Video only; a sound is trim_audio. Costs no credits; uses account storage. get_generation waits for the result.

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": {
      "source": "<source>",
      "start_seconds": "<start_seconds>",
      "duration_seconds": "<duration_seconds>"
    },
    "name": "trim_video"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYes
accurateNo
start_secondsYes
duration_secondsYes

Output Schema

NameRequiredDescriptionDefault
messageYes
generationYesOne image, clip, voice-over or piece of music.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed20 schema fields changed
    • addedOutput schema / properties / generation / description
      Added value: +"One image, clip, voice-over or piece of music."
    • addedOutput schema / properties / generation / properties / app_url / description
      Added value: +"Opens it in the app."
    • addedOutput schema / properties / generation / properties / aspect_ratio / description
      Added value: +"Null for audio."
    • addedOutput schema / properties / generation / properties / created_at / format
      Added value: +"date-time"
    • addedOutput schema / properties / generation / properties / credits
      Added value: +{
      +  "description": "Credits charged. Zero when your own provider key or the free allowance paid.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • removedOutput schema / properties / generation / properties / credits_cost
      Removed value: -{
      -  "type": [
      -    "number",
      -    "null"
      -  ]
      -}
    • addedOutput schema / properties / generation / properties / error / description
      Added value: +"Why it failed. Null otherwise."
    • removedOutput schema / properties / generation / properties / generation_id
      Removed value: -{
      -  "format": "uuid",
      -  "type": "string"
      -}
    • addedOutput schema / properties / generation / properties / id
      Added value: +{
      +  "format": "uuid",
      +  "type": "string"
      +}
    • removedOutput schema / properties / generation / properties / kind
      Removed value: -{
      -  "enum": [
      -    "image",
      -    "video",
      -    "audio",
      -    "tool"
      -  ],
      -  "type": "string"
      -}
    • addedOutput schema / properties / generation / properties / model / description
      Added value: +"The model id it was made with (`GET /v1/models`)."
    • addedOutput schema / properties / generation / properties / object
      Added value: +{
      +  "const": "generation",
      +  "type": "string"
      +}
    • addedOutput schema / properties / generation / properties / output_url / description
      Added value: +"The finished file, once `ready`. A signed link that works for about an hour; read the generation again for a fresh one."
    • addedOutput schema / properties / generation / properties / paid_by / description
      Added value: +"Who paid: \"credits\", \"house\" (the free allowance), \"server\" (a server that charges nothing), or the vendor of your own key (\"replicate\", \"fal\", …)."
    • addedOutput schema / properties / generation / properties / ready_in_seconds / description
      Added value: +"Roughly how long an unfinished generation has left; 0 means past its usual time."
    • addedOutput schema / properties / generation / properties / recipe_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/properties/generation/properties/id"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The recipe it was made with, if any."
      +}
    • addedOutput schema / properties / generation / properties / status / description
      Added value: +"`ready` and `failed` are final."
    • addedOutput schema / properties / generation / properties / thumbnail_url
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/properties/generation/properties/output_url/anyOf/0"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "A small still of the result, for a grid. Null for audio and while it works."
      +}
    • addedOutput schema / properties / generation / properties / type
      Added value: +{
      +  "description": "What was made. New values may be added; treat an unknown one as opaque.",
      +  "enum": [
      +    "image",
      +    "clip",
      +    "voiceover",
      +    "music",
      +    "tool"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / generation / required
      Previous value: -[
      -  "generation_id",
      -  "kind",
      -  "status",
      -  "model",
      -  "prompt",
      -  "aspect_ratio",
      -  "refined_from",
      -  "caption_style",
      -  "output_url",
      -  "credits_cost",
      -  "paid_by",
      -  "error",
      -  "vendor_phase",
      -  "stalled",
      -  "ready_in_seconds",
      -  "created_at",
      -  "app_url"
      -]New value: +[
      +  "object",
      +  "id",
      +  "type",
      +  "status",
      +  "model",
      +  "prompt",
      +  "aspect_ratio",
      +  "output_url",
      +  "thumbnail_url",
      +  "credits",
      +  "paid_by",
      +  "error",
      +  "ready_in_seconds",
      +  "recipe_id",
      +  "created_at",
      +  "app_url",
      +  "refined_from",
      +  "caption_style",
      +  "vendor_phase",
      +  "stalled"
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / generation / properties / paid_by
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / generation / required
      Previous value: -[
      -  "generation_id",
      -  "kind",
      -  "status",
      -  "model",
      -  "prompt",
      -  "aspect_ratio",
      -  "refined_from",
      -  "caption_style",
      -  "output_url",
      -  "credits_cost",
      -  "error",
      -  "vendor_phase",
      -  "stalled",
      -  "ready_in_seconds",
      -  "created_at",
      -  "app_url"
      -]New value: +[
      +  "generation_id",
      +  "kind",
      +  "status",
      +  "model",
      +  "prompt",
      +  "aspect_ratio",
      +  "refined_from",
      +  "caption_style",
      +  "output_url",
      +  "credits_cost",
      +  "paid_by",
      +  "error",
      +  "vendor_phase",
      +  "stalled",
      +  "ready_in_seconds",
      +  "created_at",
      +  "app_url"
      +]
  3. Changed2 schema fields changed
    • addedOutput schema / properties / generation / properties / ready_in_seconds
      Added value: +{
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / generation / required
      Previous value: -[
      -  "generation_id",
      -  "kind",
      -  "status",
      -  "model",
      -  "prompt",
      -  "aspect_ratio",
      -  "refined_from",
      -  "caption_style",
      -  "output_url",
      -  "credits_cost",
      -  "error",
      -  "vendor_phase",
      -  "stalled",
      -  "created_at",
      -  "app_url"
      -]New value: +[
      +  "generation_id",
      +  "kind",
      +  "status",
      +  "model",
      +  "prompt",
      +  "aspect_ratio",
      +  "refined_from",
      +  "caption_style",
      +  "output_url",
      +  "credits_cost",
      +  "error",
      +  "vendor_phase",
      +  "stalled",
      +  "ready_in_seconds",
      +  "created_at",
      +  "app_url"
      +]
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (which only say non-readOnly, non-destructive, non-idempotent), the description discloses billing ("Costs no credits"), resource side effects ("uses account storage"), the default encoding strategy (keyframe copy) versus the re-encode path, and the completion pattern ("get_generation waits for the result"). Those are exactly the operational facts an agent needs before invoking a non-idempotent write.

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?

Six short sentences, front-loaded with the action and output, then default behavior, then the opt-in flag, then units, exclusions, cost, and follow-up. Every sentence contributes a distinct fact and none restates the tool name 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?

The tool has an output schema, so return values need not be described; the async completion path is still noted. Cost, storage impact, default encoding, exact-mode semantics, and the video-only restriction cover everything needed to call a 4-parameter mutation correctly, apart from the unexplained source union.

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 description coverage is 0%, so the description must carry the load, and it does for the least obvious parameter: accurate is explained with its default (keyframe copy) and tradeoff (exact window for seamless cuts). It also supplies units for start_seconds and duration_seconds, which the schema's bare "number" types omit. The source parameter's upload-vs-generation union is never explained, which is a real gap for a required parameter.

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?

"Save one stretch of an owned video as a new clip" gives a specific verb (save/create a clip) and resource (a stretch of an owned video) with defined scope (one contiguous window). It explicitly separates itself from the audio sibling: "Video only; a sound is trim_audio."

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?

It states the condition that should select the non-default path ("Set accurate true to re-encode an exact window for seamless adjacent cuts") and names the audio alternative, trim_audio, with an explicit exclusion. It does not address when to trim versus neighboring video tools such as join_clips, loop_video, or extract_video_frame, so routing among video-manipulation siblings is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources