Skip to main content
Glama

media_convert

Convert video and audio files between formats using presets for MP4, WebM, GIF, Instagram Reels, and YouTube Shorts, with dry-run planning and output verification.

Instructions

Convert video and audio files between formats. Includes presets for web MP4 (H.264/AAC), WebM (VP9/Opus), animated GIF, Instagram Reels (9:16), and YouTube Shorts (9:16). Supports dryRun plan inspection and verified output probing.

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": "media_convert"
  }
}

Input Schema

NameRequiredDescriptionDefault
crfNoQuality factor from 0 to 51. Lower numbers mean higher quality. Default: 23 for MP4, 30 for WebM.
fpsNoTarget frame rate in frames per second, such as 30, 60, or 15
dryRunNoPlan-before-encode: returns planned FFmpeg command, parameters, and target output without writing files.
presetNoEncoding preset: 'web_mp4' for browser playback, 'webm' for WebM video, 'gif' for animated GIF, 'instagram_reel' (9:16 vertical 30fps), 'youtube_shorts' (9:16 vertical 60fps), or 'auto'. Default: 'auto'.
inputPathYesPath to the source media file to convert
outputPathYesDestination path for the converted file (e.g. ./output.mp4, ./output.webm, ./animation.gif)
resolutionNoTarget size formatted as 'WIDTHxHEIGHT', such as '1920x1080' or '1280x720'
hardwareAccelerationNoUse hardware-accelerated video encoding (VideoToolbox, NVENC, QSV, etc.) when available. Default: true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields 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"
      +}
    • changedInput schema / properties / preset / description
      Previous value: -"Encoding preset: 'web_mp4' for browser playback, 'webm' for WebM video, 'gif' for animated GIF, or 'auto'. Default: 'auto'."New value: +"Encoding preset: 'web_mp4' for browser playback, 'webm' for WebM video, 'gif' for animated GIF, 'instagram_reel' (9:16 vertical 30fps), 'youtube_shorts' (9:16 vertical 60fps), or 'auto'. Default: 'auto'."
    • changedInput schema / properties / preset / enum
      Previous value: -[
      -  "web_mp4",
      -  "webm",
      -  "gif",
      -  "auto"
      -]New value: +[
      +  "web_mp4",
      +  "webm",
      +  "gif",
      +  "instagram_reel",
      +  "youtube_shorts",
      +  "auto"
      +]
  2. Changed1 schema field changedv0.5.1
    • addedInput schema / properties / resolution / pattern
      Added value: +"^\\d{2,5}x\\d{2,5}$"
  3. 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."
  4. Changed7 schema fields changedv0.4.2
    • changedInput schema / properties / crf / description
      Previous value: -"Constant Rate Factor quality (0-51). Lower is higher quality. Default: 23 for H.264, 30 for VP9."New value: +"Quality factor from 0 to 51. Lower numbers mean higher quality. Default: 23 for MP4, 30 for WebM."
    • changedInput schema / properties / fps / description
      Previous value: -"Target frame rate, e.g. 30, 60, or 15 (great for GIFs)"New value: +"Target frame rate in frames per second, such as 30, 60, or 15"
    • changedInput schema / properties / hardwareAcceleration / description
      Previous value: -"Use Apple Silicon VideoToolbox hardware 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 input media file"New value: +"Path to the source media file to convert"
    • changedInput schema / properties / outputPath / description
      Previous value: -"Destination file path (e.g. ./output.mp4)"New value: +"Destination path for the converted file (e.g. ./output.mp4, ./output.webm, ./animation.gif)"
    • changedInput schema / properties / preset / description
      Previous value: -"Encoding preset. 'web_mp4' ensures universal browser playback (H.264/yuv420p/faststart). 'gif' uses 2-pass palette generation."New value: +"Encoding preset: 'web_mp4' for browser playback, 'webm' for WebM video, 'gif' for animated GIF, or 'auto'. Default: 'auto'."
    • changedInput schema / properties / resolution / description
      Previous value: -"Target resolution, e.g. '1920x1080', '1280x720', '640x360'"New value: +"Target size formatted as 'WIDTHxHEIGHT', such as '1920x1080' or '1280x720'"
  5. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / hardwareAcceleration
      Added value: +{
      +  "description": "Use Apple Silicon VideoToolbox hardware acceleration if available (default: true)",
      +  "type": "boolean"
      +}
  6. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description must carry the entire behavioral burden. It does add real value by disclosing dryRun semantics (returns the planned FFmpeg command without writing files) and 'verified output probing', but it is silent on overwrite behavior for an existing outputPath, failure/cleanup behavior on partial encodes, and whether hardware acceleration silently falls back to software.

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?

Three short sentences, front-loaded with the core action before the preset and dryRun details, with no filler. Minor redundancy between the preset enumeration and the schema's own enum descriptions keeps it from a 5.

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?

For an 8-parameter mutation tool with no annotations and no output schema, the description covers the main concepts (presets, dryRun planning, output verification) but leaves gaps on overwrite policy, error behavior, and return shape of a non-dryRun conversion. Adequate to invoke correctly in the common case, incomplete for edge cases.

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 documents crf, fps, preset, resolution, and hardwareAcceleration thoroughly. The description's preset list mostly restates the enum, though the codec pairings (H.264/AAC, VP9/Opus) add modest meaning beyond the schema's platform-oriented wording. Baseline 3 applies since the schema does the heavy lifting.

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?

The description opens with a specific verb and resource ('Convert video and audio files between formats') and enumerates the concrete output targets (MP4/H.264, WebM/VP9, GIF, 9:16 reels and shorts). It implicitly separates itself from siblings like extract_audio or trim_media, but never explicitly contrasts with compress_video or reformat_aspect_ratio, which also produce 9:16 or size-reduced output.

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 only implied through the preset list: an agent can infer 'pick instagram_reel for vertical social video', and dryRun is described as a planning mode. There is no explicit statement of when to prefer this tool over compress_video (for size reduction) or reformat_aspect_ratio (for aspect changes alone), and no prerequisites such as FFmpeg availability are mentioned.

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