Skip to main content
Glama

compress_video

Compress video files to meet upload limits by specifying a target size or CRF quality level; optionally plan with dryRun and verify output after encoding.

Instructions

Compress video files to fit upload limits (such as GitHub PRs under 10MB or Discord under 25MB) using target file sizes or CRF quality levels. Supports dryRun and post-flight verification.

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": {
      "inputPath": "<inputPath>",
      "outputPath": "<outputPath>"
    },
    "name": "compress_video"
  }
}

Input Schema

NameRequiredDescriptionDefault
crfNoQuality value between 18 (higher quality) and 45 (smaller file). Overrides preset.
dryRunNoPlan-before-encode: returns planned FFmpeg command, parameters, and target output without writing files.
presetNoPreset when targetSizeMB is not set: 'github_pr', 'discord', 'email', 'balanced', or 'high_quality'. Default: 'balanced'.balanced
maxWidthNoMaximum video width in pixels, such as 1280 for 720p. Keeps aspect ratio.
inputPathYesPath to the source video file (e.g. './recordings/demo.mov')
outputPathYesDestination path for the compressed MP4 file (e.g. './recordings/demo_compressed.mp4')
targetSizeMBNoTarget output size in megabytes, such as 9.5 for GitHub or 24 for Discord. Computes bitrates from duration.
hardwareAccelerationNoUse hardware-accelerated video encoding (VideoToolbox, NVENC, QSV, etc.) when available. Default: true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.1
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "description": "Plan-before-encode: returns planned FFmpeg command, parameters, and target output without writing files.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv0.5.0
    • changedInput schema / properties / hardwareAcceleration / description
      Previous value: -"Use Apple Silicon VideoToolbox encoding when available. Default: true."New value: +"Use hardware-accelerated video encoding (VideoToolbox, NVENC, QSV, etc.) when available. Default: true."
  3. Changed7 schema fields changedv0.4.2
    • changedInput schema / properties / crf / description
      Previous value: -"Custom Constant Rate Factor (18=near lossless, 23=default, 28=small, 35=very small)"New value: +"Quality value between 18 (higher quality) and 45 (smaller file). Overrides preset."
    • changedInput schema / properties / hardwareAcceleration / description
      Previous value: -"Whether to use Apple Silicon VideoToolbox acceleration if available (default: true)"New value: +"Use Apple Silicon VideoToolbox encoding when available. Default: true."
    • changedInput schema / properties / inputPath / description
      Previous value: -"Path to the source video file"New value: +"Path to the source video file (e.g. './recordings/demo.mov')"
    • changedInput schema / properties / maxWidth / description
      Previous value: -"Optional maximum width to downscale (e.g. 1280 for 720p)"New value: +"Maximum video width in pixels, such as 1280 for 720p. Keeps aspect ratio."
    • changedInput schema / properties / outputPath / description
      Previous value: -"Target path for compressed output file"New value: +"Destination path for the compressed MP4 file (e.g. './recordings/demo_compressed.mp4')"
    • changedInput schema / properties / preset / description
      Previous value: -"Compression preset if targetSizeMB is not specified"New value: +"Preset when targetSizeMB is not set: 'github_pr', 'discord', 'email', 'balanced', or 'high_quality'. Default: 'balanced'."
    • changedInput schema / properties / targetSizeMB / description
      Previous value: -"Optional target file size in Megabytes (e.g., 10 for GitHub PRs, 25 for Discord)"New value: +"Target output size in megabytes, such as 9.5 for GitHub or 24 for Discord. Computes bitrates from duration."
  4. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / hardwareAcceleration
      Added value: +{
      +  "description": "Whether to use Apple Silicon VideoToolbox acceleration if available (default: true)",
      +  "type": "boolean"
      +}
  5. First observedv0.1.0

TDQS

A3.6/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 behavioral burden; it does disclose that dryRun produces a plan without writing files, which is genuinely useful. "Post-flight verification" is mentioned but never explained, and critical mutation traits — overwrite behavior when outputPath already exists, relative time cost, failure modes on long encodes — are absent.

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, front-loaded with purpose and use cases, then the safety/verification mechanisms. Every clause carries information; nothing is padding.

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 an 8-parameter mutation tool with no annotations and no output schema, the description covers purpose, dual sizing strategies, and the dry-run escape hatch, which is enough to call it correctly. It falls short of full completeness because return values and the verification step's outcome are never described, and overwrite semantics are left unstated.

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 coverage is 100%, so every parameter is already documented in the input schema (including CRF range, preset enum, and targetSizeMB semantics), which sets the baseline at 3. The description only adds a high-level framing of the two sizing strategies and does not clarify precedence between targetSizeMB, preset, and crf beyond what the schema states.

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 ("Compress video files") plus the concrete outcome it targets (fitting upload limits like GitHub's 10MB / Discord's 25MB) and the two control strategies (target size or CRF). It is clearly distinguishable from a generic convert tool, but never names a sibling such as media_convert, so the differentiation is inferred rather than stated.

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?

The upload-limit framing implies when to reach for this tool (you need a file under N MB), which is useful context. However, there is no explicit when-not guidance and no comparison to sibling tools like media_convert or trim_media, so an agent must infer whether compression or re-encoding is the right choice.

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