Skip to main content
Glama

resync

Fix subtitle timing drift and constant offset by applying anchor-point or frame-rate corrections to every cue in SRT/VTT files.

Instructions

Fix a subtitle that is out of sync by an amount that CHANGES through the film (drift) as well as a constant offset. Give anchor points: a line in the file and the time it should really appear. Two anchors (one near the start, one near the end) define the straight line new = a*old + b exactly; with three or more a least-squares line is fitted. The tool applies it to every start and end time and reports the error left at each anchor.

Find anchors with search_subtitles / read_cues: take a distinctive line near the start and one near the end, play the video to find when each is really spoken.

Alternatively give fps_from and fps_to (no anchors) when the subtitle was timed for a video at one frame rate and your video runs at another (for example fps_from=25, fps_to=23.976).

Args: path: .srt or .vtt file. anchors: list of {"cue": 12, "to": "00:03:10,400"} (cue = cue number, its START is moved) or {"at": "00:03:05,000", "to": "00:03:10,400"} (at = the current wrong time). fps_from: frame rate the subtitle was made for. fps_to: frame rate of the video you have. output: where to write (default: .resynced.). overwrite: allow replacing an existing output file (default false). encoding: force the input text encoding. output_encoding: encoding of the written file (default utf-8).

Input Schema

NameRequiredDescriptionDefault
pathYes
fps_toNo
outputNo
anchorsNo
encodingNo
fps_fromNo
overwriteNo
output_encodingNoutf-8

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that the transform is applied to every start and end time, that per-anchor residual error is reported, the default output filename, and that overwrite defaults to false. It stops short of stating whether the input file is ever modified in place or what permissions/limits apply, so not a 5.

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?

Front-loaded with the core behavior and the anchor/fps decision, then a compact Args block. It is longer than most definitions but nearly every sentence adds operational value; the least-squares detail is arguably more than needed but supports the 'three or more anchors' case.

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 an eight-parameter mutation tool with no annotations, the description covers the math, both input modes, anchor construction, output location, and overwrite safety. An output schema exists, and the description still notes that residual error per anchor is reported, so nothing an agent needs is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and it does: all eight parameters are explained, including the two accepted anchor object shapes (cue vs at) and the fact that a cue anchor moves the cue's START. Defaults for output, overwrite, and output_encoding are restated with meaning.

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 specific verb and resource ('Fix a subtitle that is out of sync') and immediately scopes it to drift plus constant offset, which distinguishes it from the sibling shift tool that handles constant offset only. An agent can pick between resync and shift from the description alone.

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

Usage Guidelines5/5

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

Gives explicit when-to-use branches: anchors for drift, fps_from/fps_to when the subtitle was timed for a different frame rate, with a concrete example (25 to 23.976). It also tells the agent how to obtain anchors via search_subtitles / read_cues and what to do in the video.

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