Skip to main content
Glama

MP4 to GIF API - convert video to an animated GIF that fits a size limit

mp4_to_gif
Read-onlyIdempotent

Convert an MP4, MOV, WebM, MKV or AVI video (base64, max 15 MB) into an animated GIF with a two-pass colour palette. Trim by start and length (up to 30 s), set width, frames per second, speed, centre crop (square, vertical, wide), loop count, reverse or boomerang. maxSizeMb re-makes the GIF smaller (width, then frames/s, then colours) until it fits, and the response says what was reduced. Deterministic local ffmpeg, 0 AI, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.004/call via x402 at https://radarbg.com/x402/mp4-to-gif.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fps": "10",
      "start": "0",
      "width": "320",
      "length": "2",
      "maxSizeMb": 2
    },
    "name": "mp4_to_gif"
  }
}

Input Schema

NameRequiredDescriptionDefault
fpsNoFrames per second (lowered automatically when a GIF would exceed 360 frames)12
cropNoCentre crop: keep, square 1:1, vertical 9:16 or wide 16:9keep
loopNoHow often the GIF playsforever
speedNoPlayback speed: 0.5 slow motion, 2 or 4 fast1
startNoWhere the GIF starts: seconds (12.5) or mm:ss (0:12)0
widthNoGIF width in pixels, never upscaled (orig = source width up to 800)480
lengthNoSeconds of video to use, max 30 (empty = to the end of the video)
qualityNoColours and dithering: best (256, smooth), balanced (256), small (128), tiny (64)balanced
reverseNoPlay backwards (uses up to 10 s, 480 px)
fileNameNoOptional file name, e.g. clip.mp4 (the GIF gets the same name)
boomerangNoForward then backward (uses up to 10 s, 480 px)
maxSizeMbNoLargest GIF size in MB, 0.2 to 10. The GIF is re-made smaller until it fits
fileContentNoBase64-encoded video: MP4, MOV, WebM, MKV or AVI (max 15 MB; empty = built-in 3-second sample MP4)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the read-only, idempotent, open-world annotations, the description discloses important behavior: two-pass colour palette generation, deterministic local ffmpeg processing, no AI, nothing stored, automatic re-encoding to meet maxSizeMb, and a response indicating what was reduced. It also explains free-tier limits and paid authentication options.

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?

The description is front-loaded with the conversion purpose and key capabilities, and most sentences earn their place by covering limits, output behavior, privacy, and access. It is dense and somewhat run-on, with pricing URL details that are useful but slightly crowded into the main paragraph.

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 13-parameter conversion tool with no output schema, the description is largely complete: it covers accepted inputs, size and duration limits, output-shaping options, automatic reduction behavior, and access constraints. The main remaining gap is that it does not explicitly state the response format, such as whether the GIF is returned as base64, a URL, or another payload shape.

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 100%, so the baseline is 3, but the description adds cross-parameter meaning. It explains that maxSizeMb progressively reduces width, then frames per second, then colours until the GIF fits, and it ties trimming, crop modes, reverse, boomerang, and duration limits together.

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?

The description states a specific verb and resource: converting MP4, MOV, WebM, MKV or AVI video into an animated GIF. It also distinguishes itself from nearby conversion siblings by naming GIF-specific constraints such as palette generation, trimming, cropping, and max size enforcement.

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?

The description gives clear context for when this tool is appropriate: turning short video clips into size-limited animated GIFs. It does not explicitly name alternative tools or exclusions, but the conversion target and constraints make the use case unambiguous.

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