Skip to main content
Glama

Replace media

clip.replace
Idempotent

Swap the media in a clip, keeping its place, length, speed and look. Starts at source_in (default 0). Its linked clips swap too (linked: false for this clip only); clip_ids lists every clip swapped. Returns the new timeline_id (edit that one next), what changed, and where each changed clip now sits.

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": {
      "clip_id": "<clip_id>",
      "media_id": "<media_id>",
      "timeline_id": "<timeline_id>"
    },
    "name": "clip.replace"
  }
}

Input Schema

NameRequiredDescriptionDefault
linkedNoAlso swap its linked clips (its sound, or its picture) onto the new media, keeping their offset, where the new media has that kind; false swaps this clip only
clip_idYes
previewNoinline: image in the result; link: URI that renders on read; nonelink
media_idYesMedia handle from media.import or a create.* tool
source_inNoSource frame the clip starts at. Default 0
timeline_idYesTimeline handle; every edit returns a new one

Output Schema

NameRequiredDescriptionDefault
parentYesThe version this edit started from
changedYesWhat the edit added, removed or modified; a clip or transition says its track and where it now sits (frames, end exclusive)
clip_idNoThe clip this edit made or acted on (each tool says which)
previewYes
clip_idsNoEvery clip this edit made or acted on, linked ones included (each tool says which)
track_idNo
warningsYes
timeline_idYesThe new version: edit this one next (older ids stay valid)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedOutput schema / properties / changed / description
      Added value: +"What the edit added, removed or modified; a clip or transition says its track and where it now sits (frames, end exclusive)"
    • addedOutput schema / properties / clip_id / description
      Added value: +"The clip this edit made or acted on (each tool says which)"
    • addedOutput schema / properties / clip_ids / description
      Added value: +"Every clip this edit made or acted on, linked ones included (each tool says which)"
    • changedOutput schema / properties / parent / description
      Previous value: -"Timeline handle; every edit returns a new one"New value: +"The version this edit started from"
    • changedOutput schema / properties / timeline_id / description
      Previous value: -"Timeline handle; every edit returns a new one"New value: +"The new version: edit this one next (older ids stay valid)"
  2. Changed1 schema field changed
    • addedInput schema / properties / linked
      Added value: +{
      +  "default": true,
      +  "description": "Also swap its linked clips (its sound, or its picture) onto the new media, keeping their offset, where the new media has that kind; false swaps this clip only",
      +  "type": "boolean"
      +}
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare the safety profile (readOnly=false, destructive=false, idempotent=true), and the description adds genuine value beyond that: it discloses that linked clips are also swapped by default, that clip_ids enumerates every affected clip, and that the returned timeline_id is the handle for subsequent edits. It does not cover failure modes or what happens when the new media lacks a matching kind, which is the main remaining gap.

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?

Three tight sentences, front-loaded with the core action and the preservation guarantee, followed by input defaults and then outputs. No filler and nothing redundant to the point of 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?

An output schema exists, so return values need only be gestured at, and the description does exactly that (new timeline_id, what changed, new positions). Combined with annotations and an 83%-covered schema, an agent has nearly everything needed; only edge-case behavior (media length mismatch, what happens with linked kind unavailable) is unaddressed.

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 83%, so the schema already documents linked, source_in and media_id in detail; the description mostly restates these ("Starts at source_in (default 0)", the linked-clip note). It adds no information about preview or the media handle format. With the schema doing the heavy lifting, the baseline 3 is appropriate.

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?

"Swap the media in a clip" is a specific verb+resource pair, immediately disambiguated from neighbouring operations by the preservation clause "keeping its place, length, speed and look" — which distinguishes it from clip.slip, clip.slide and clip.trim. An agent can identify the operation without opening the schema.

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?

Gives a clear usage context (media swap that preserves timing/look) and states the key branching behavior for the linked parameter ("linked: false for this clip only"). It also tells the agent what to do next ("Returns the new timeline_id (edit that one next)"), but never names an alternative tool or an explicit when-not condition.

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.