Fix subtitles
fix_subtitlesUse this when the user wants to fix subtitle timing or convert subtitles: shift an SRT or VTT file earlier or later, convert it from one frame rate to another (23.976, 24, 25, 29.97, 30, 50, 59.94, 60), sync it on two cues, trim overlapping cues, give short cues a minimum duration, strip formatting tags, renumber, or convert SRT to WebVTT and back. Takes one attached .srt or .vtt file (or the subtitle text) and returns the fixed file and a CSV change log with old and new times per cue. Times are whole milliseconds, rounded half up. Does not listen to audio or find the right offset by itself, does not translate or edit the words, and does not read SSA/ASS files.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "fix_subtitles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | The subtitle file: one .srt or .vtt file in UTF-8 or UTF-16 with a byte order mark, e.g. movie.srt. | |
| sync | No | Two-point sync: cue_a should start at time_a and cue_b at time_b; all times are mapped on that straight line. Do not combine with shift_ms or frame rates. | |
| gap_ms | No | Gap kept before the next cue when fixing overlaps or extending cues, 0 to 1000 ms, e.g. 1 (default). | |
| to_fps | No | Frame rate of the video they should match, e.g. 23.976. One of 23.976, 24, 25, 29.97, 30, 50, 59.94 or 60. new time = old time x from_fps / to_fps. | |
| from_fps | No | Frame rate the subtitles were timed for, e.g. 25. One of 23.976, 24, 25, 29.97, 30, 50, 59.94 or 60. Use with to_fps. | |
| renumber | No | SRT output: true (default) numbers cues 1, 2, 3 in output order; false keeps the numbers as written. | |
| shift_ms | No | Move all cues by this many milliseconds: positive = later, negative = earlier, e.g. 2500 (2.5 s later) or -1200. Limit 24 hours. | |
| strip_tags | No | true removes formatting tags such as <i>, <b>, <u>, <font>, WebVTT <c>/<v> tags and {\an8} codes from the text. Default false. | |
| fix_overlaps | No | true: when a cue ends after the next cue starts, or less than gap_ms before it, its end moves to gap_ms before that start. Default false. | |
| line_endings | No | Line endings of the output, e.g. crlf. Default same as the input (CRLF, LF, or CR for old Mac files). | |
| output_format | No | Output format, e.g. vtt to convert SRT to WebVTT. Default same as the input. | |
| sort_by_start | No | true writes cues in start-time order (stable). Default false keeps the file order. | |
| subtitle_text | No | Instead of a file: the subtitle text itself, e.g. "1\n00:00:01,000 --> 00:00:03,000\nHello". Use either file or subtitle_text. | |
| min_duration_ms | No | Make short cues last at least this long, up to gap_ms before the next cue, e.g. 1000. 0 (default) = off. Limit 10000. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| check | Yes | ||
| notes | Yes | ||
| counts | Yes | ||
| timing | Yes | ||
| cues_in | Yes | ||
| removed | Yes | ||
| cues_out | Yes | ||
| encoding | Yes | ||
| log_name | Yes | ||
| downloads | Yes | ||
| format_in | Yes | ||
| format_out | Yes | ||
| output_name | Yes | ||
| changes_preview | Yes | ||
| expires_in_hours | Yes | ||
| changes_preview_count | No |