Skip to main content
Glama

Retime / resync captions

retime_captions

Correct drifting captions by adjusting timing via frame-rate conversion, a stretch factor, or two sync points, so subtitles stay aligned from start to finish.

Instructions

Fix captions that drift (in sync at the start, increasingly off later). Three modes: fps — convert between frame rates (e.g. 23.976 → 25 PAL speed-up); factor — stretch by a multiplier; sync_points — give the correct time for two cues and everything is mapped linearly between them (most accurate).

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": {
      "mode": "<mode>"
    },
    "name": "retime_captions"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYes
pathNoLocal caption file (.srt, .vtt, .ass/.ssa, .json). ~ is expanded.
factorNomode=factor: multiply all times by this.
formatNoInput format. Detected automatically when omitted.
to_fpsNomode=fps: frame rate of the video they should match.
contentNoCaption text, if you don't have a file.
from_fpsNomode=fps: frame rate the captions were timed for.
overwriteNoAllow replacing an existing file.
output_pathNoWrite the result here. Format follows the extension unless `to` is set. Omit to get the text back inline.
sync_pointsNo
output_formatNoOutput format. Defaults to the input format (or the output_path extension).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations declare a non-read-only, non-destructive write operation, and the description adds real behavioral substance about how each mode transforms timings. However, it never mentions that the tool can write to disk, that overwrite=true is required to replace an existing file, or that output is returned inline when output_path is omitted — relevant given the destructive-ish overwrite path.

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?

Two sentences, zero waste: the problem statement comes first, then the mode breakdown with the recommended mode marked. An agent can act on it immediately.

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 an 11-parameter tool with a nested sync_points object and no output schema, the description covers the mode logic but says nothing about the return path (inline text vs. file write), format auto-detection, or how sync_points values are formatted. Adequate but with real gaps for a moderately complex tool.

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 82%, so the baseline is 3; the description earns a step up by explaining what the mode enum values actually do and by giving the PAL speed-up example that makes from_fps/to_fps concrete. It adds nothing for factor, path, format, or overwrite, but the schema already documents those.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (fix/retime captions) and pins the exact failure mode it addresses: drift that grows over time, as opposed to a constant offset. That framing implicitly separates it from shift_captions, but no sibling is named explicitly.

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?

Clearly explains when each of the three modes applies: fps for frame-rate conversion with a concrete 23.976 → 25 PAL example, factor for a plain multiplier, and sync_points when two known cues exist (flagged as most accurate). It gives no guidance on when not to use the tool or which alternative to pick over a constant-shift tool.

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