Skip to main content
Glama

Stitch videos

var2_join_videos

Stitch videos / images / audio into one mp4 on a 30fps timeline. Fractional seconds are supported and rounded to frames, not whole seconds; the plan returns timeline_frames and fps. For a VERIFIED duplicated shared endpoint between 30fps clips, shorten the preceding clip by exactly 1/30 second, preserve the next first frame, and use no transition. A shared reference image does not prove actual endpoints match or eliminate duplicate frames; this tool does not extract or compare frames. Never replace one-frame removal with an arbitrary 0.2–0.5 second trim. Continuous background audio spans the joined timeline. Two-pass: dry_run=true (default) returns a plan to review with the user; dry_run=false renders it. Poll with var2_check_join_status (NOT var2_get_video_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": {
      "segments": "<segments>",
      "aspect_ratio": "<aspect_ratio>",
      "resolution": "<resolution>"
    },
    "name": "var2_join_videos"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoOptional project name shown in the user's editor.
dry_runNoWhen true (default), returns the planned timeline + render-time estimate WITHOUT actually queuing the render, plus a `plan_id`. ALWAYS call with dry_run=true first, show the plan to the user, get explicit approval, then render by calling with ONLY {plan_id} — no other parameters needed. Renders take minutes-to-hours and use compute budget — never run without confirmation.
plan_idNoRender an approved plan exactly as shown: after user approval, call with ONLY {plan_id} — nothing else needed (dry_run defaults to render when plan_id is present). A jp_… id ALWAYS comes back HERE to START the render — it is a plan id, NOT a status id (status ids are plain UUIDs and go to var2_check_join_status). {plan_id, dry_run:true} re-displays the stored plan. If any parameter changed after the dry-run, resend full args instead.
segmentsYesOrdered list of clips on the timeline. ALWAYS ask the user about the order before calling — the order matters and cannot be changed after rendering starts.
resolutionYesREQUIRED — always ask the user. 1080p renders roughly 2× longer than 720p but produces a sharper output.
aspect_ratioYesREQUIRED — always ask the user which one they want. 16:9 = landscape (YouTube/desktop), 9:16 = portrait (TikTok/Reels/Shorts), 1:1 = square (Instagram feed).
background_audio_urlNoOptional separate audio track that spans the whole video (storage/signed URL, var2 share link, or placeholder_id — resolved server-side). Ask the user if they want background music.
background_audio_volumeNo
video_audio_when_stackedNoHow to handle the video's native audio when an audio source is layered on top (inline audio segments OR background_audio_url). When the timeline stacks video + audio, ALWAYS ask the user — and recommend `mute` as the first option (cleanest result, no clashing tracks). `reduce` keeps video audio at 0.2× under the music. `keep` plays both at full volume (usually clashes).
background_audio_placeholder_idNoSTRONGLY RECOMMENDED whenever `background_audio_url` is set. The placeholder_id of the asset behind that URL (e.g. the id returned by var2_upload_asset). Without it the editor opens the saved project with an empty background-audio clip — no waveform, no playback in preview — even though the rendered mp4 mixes the audio correctly. The server auto-extracts var2 UUIDs from var2.ai share-page URLs and Supabase storage paths when possible.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false; the description adds substantial context beyond them — renders take minutes-to-hours and consume compute budget, there is NO server-side probing of source durations, the tool does not extract or compare frames, and clip order cannot be changed once rendering starts. It also discloses the duplicate-endpoint remedy (shorten the preceding clip by exactly 1/30s) and warns against the tempting wrong fix.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with the purpose, but the remainder is a dense wall of interleaved rules covering frame rounding, duplicate frames, audio spanning, and the two-pass workflow. The highly specific anti-pattern warnings ('Never replace one-frame removal with an arbitrary 0.2–0.5 second trim') are low-frequency edge cases that crowd out more generally applicable guidance.

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 10-parameter mutation tool with no output schema, the description covers the essential gaps: it names the plan outputs (timeline_frames, fps, plan_id), the render cost profile, and the exact polling endpoint. What remains thin is the post-render outcome — the description never says what a completed render returns or how the finished mp4 is retrieved.

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 90%, so the schema already carries nearly all parameter meaning, including the dry_run/plan_id round-trip and the duration_seconds frame-rounding rule. The description largely restates that guidance (30fps timeline, 1/30s correction) rather than adding new per-parameter semantics, so the baseline 3 applies.

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 first sentence states a specific verb, resource, and output format: 'Stitch videos / images / audio into one mp4 on a 30fps timeline.' It also scopes the behavior precisely (fractional seconds rounded to frames, plan returns timeline_frames and fps), so an agent knows exactly what this produces and at what frame budget.

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 two-pass workflow is spelled out unambiguously: dry_run=true returns a plan to review with the user, dry_run=false renders, and status must be polled with var2_check_join_status, explicitly NOT var2_get_video_result. The only gap is that nothing says when to choose this over other composition-style siblings (e.g. var2_render_timeline), so the alternative comparison is limited to the polling endpoint.

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