Skip to main content
Glama

Relink media

relink_media
Destructive

Point bin clips at new media files after moving a media folder. Updates every bin and timeline instance while preserving timing, IDs, and effects, then writes the project to a destination file.

Instructions

Point bin clips at new media files, for example after moving a media folder. mapping maps a bin_id, a stored reference or a resolved path (from list_project_media) to the new absolute path. Every copy of the clip (bin and timeline instances) is updated; timing, ids and effects are kept. The new file is read by MLT first: fewer frames than the timeline uses, or a missing video/audio stream it uses, is refused ([media_mismatch]); other differences are warnings. Clips using a proxy are refused. The result is written to destination with the save_project_copy rules.

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": {
      "path": "<path>",
      "mapping": "<mapping>",
      "destination": "<destination>"
    },
    "name": "relink_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of a .kdenlive project file on this machine.
mappingYes{bin_id | old reference | old resolved path: new absolute path}
overwriteNoAllow replacing an existing destination file.
destinationYesAbsolute path of the .kdenlive file to write (the source by default is never modified; see save_project_copy for the overwrite rules).
expected_sha256NoRequired to write over the source: its sha256 as last read. Tools that take `revision` use it when this is omitted.

Output Schema

NameRequiredDescriptionDefault
audioNo
mediaNo
savedYes
titleNo
trackNo
relinkNo
effectsNo
markersNo
timelineNo
subtitlesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare destructive=true and non-idempotent; the description adds substantial context beyond that: every bin and timeline instance is updated, timing/ids/effects are preserved, the source project is never modified, and the new file is validated by MLT with a specific refusal code ([media_mismatch]) versus warnings. It also discloses the proxy restriction, which an agent could not infer from annotations or schema.

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?

Front-loaded with purpose, then mapping semantics, then effects, then validation/refusal behavior, then output destination. Every sentence carries distinct operational information; no filler or restatement of the name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation with five parameters, nested mapping, and cross-tool dependencies, the description covers side effects, preservation guarantees, validation outcomes, refusal conditions, and where output lands. An output schema exists, so return values need no explanation here.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning: it explains the three accepted key forms for `mapping` (bin_id, stored reference, resolved path) and tells the agent where resolved paths come from (list_project_media), and it clarifies `destination` semantics by deferring to save_project_copy rules. `overwrite` and `expected_sha256` are left entirely to the schema.

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?

States a precise verb and resource: 'Point bin clips at new media files', with the canonical scenario ('after moving a media folder') given immediately. This is clearly distinguishable from adding new media (add_media_to_bin) or probing files, since it re-points existing clips rather than creating entries.

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 an explicit triggering situation ('after moving a media folder') and enumerates the conditions under which the tool refuses to act: insufficient frames, missing streams it uses, and proxy-based clips. It also points to save_project_copy for destination/overwrite rules. It stops short of naming an explicit alternative for the 'new media' case, so not a full when/when-not/alternatives treatment.

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