Skip to main content
Glama

video_matting

Extract a clean alpha foreground from video with temporal smoothing and optional shadow preservation, then export transparent WebM/MOV or composite onto replacement backgrounds, retaining audio.

Instructions

Extract a clean AI-matted alpha foreground from a single video clip with 3-frame temporal edge smoothing and optional contact-shadow preservation, then export transparent alpha video (VP9 WebM / ProRes 4444 MOV) and/or composite onto 1..N replacement background images while preserving original audio.

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": {
      "src_video": "<src_video>",
      "out_dir": "<out_dir>"
    },
    "name": "video_matting"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNorembg segmentation model (e.g. isnet-general-use, u2net, u2net_human_seg, birefnet-general).isnet-general-use
out_dirYesOutput directory for alpha video(s), composited MP4(s), and preview strip.
src_videoYesPath to input foreground video file.
blur_sigmaNoSlight Gaussian blur applied to replacement backgrounds for natural depth of field.
keep_audioNoPreserve original audio track in composited MP4 outputs.
max_framesNoOptional frame cap for quick preview runs (0 = process full video).
backgroundsNoOptional list of replacement background image paths.
export_webmNoExport transparent VP9 WebM (yuva420p).
keep_shadowNoPreserve subtle natural floor contact shadow on replacement backgrounds.
chroma_boostNoOptional soft alpha rescue for glowing/translucent props of a dominant color.none
export_proresNoExport transparent ProRes 4444 MOV (yuva444p10le, large file).
backgrounds_dirNoOptional directory of background images to batch-composite onto.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/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 usefully discloses 3-frame temporal edge smoothing, optional shadow preservation, export formats, and audio preservation, but it omits operational details like file overwrite behavior, processing cost, permissions, and runtime characteristics.

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 definition is front-loaded with the core action and remains focused on relevant capabilities. It is a long single sentence with several dense clauses, but it avoids repetition and does not waste space on irrelevant details.

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 a complex 12-parameter video processing tool with no annotations or output schema, the description covers the core workflow and output formats but falls short on operational completeness. It does not explain file handling, overwrite behavior, output previews, or performance constraints that would help an agent invoke it confidently.

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 all 12 parameters thoroughly. The description adds context about the matting pipeline but does not explain parameter syntax or meaning beyond what the schema provides, warranting the baseline score.

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 names a specific verb and resource: extracting an AI-matted alpha foreground from a single video clip, then exporting transparent video or compositing onto backgrounds. It clearly conveys the tool's scope and output formats, making its purpose unmistakable even without sibling-specific routing.

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

Usage Guidelines2/5

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

The description explains what the tool does but provides no when-to-use guidance, exclusions, or comparison to alternatives such as clip_wash or tiktok_download. An agent must infer appropriate usage from the purpose alone.

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