Skip to main content
Glama

fix_common_problems

Repair common SRT/WebVTT issues like out-of-order, overlapping, empty or misindexed cues, long lines, and encoding problems. It reports fixes by default; set apply=true to write the corrected file.

Instructions

Repair the usual damage in SRT/WebVTT files. DRY RUN BY DEFAULT: it lists every fix it would make (with cue numbers and before/after times) and writes nothing until you call again with apply=true.

Fixes: out-of-order cues are re-sorted; cues with end <= start get a readable duration (never past the next cue); overlapping cues are trimmed to the next cue's start; empty cues and blank lines inside cues are removed; missing/duplicate/wrong SRT index numbers are renumbered; lines longer than max_line_length are re-wrapped (balanced; dialogue dashes keep one speaker per line); the BOM and mixed CR/LF line endings are normalised. With strip_tags=true, HTML/font/WebVTT/ASS tags are removed from the text.

Flagged but never changed: reading-speed outliers (more than max_cps characters per second) and cues on screen for over 10 seconds; overlapping cues that start together.

Args: path: .srt or .vtt file. apply: false (default) = report only; true = write the repaired file. strip_tags: also remove , , <font ...>, <v ...>, {\an8} etc. (default false). max_line_length: wrap lines longer than this many visible characters (default 42). max_cps: reading-speed flag threshold in characters per second (default 25). output: where to write when apply=true (default: .fixed.). 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
applyNo
outputNo
max_cpsNo
encodingNo
overwriteNo
strip_tagsNo
max_line_lengthNo
output_encodingNoutf-8

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description fully carries the behavioral burden: it states that the default is a dry run, lists every fix type with before/after reporting, explains what is flagged but never changed, and documents write/output defaults. This gives the agent a strong safety and behavior model before invoking a mutating repair tool.

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?

The description is front-loaded with the dry-run warning and then organizes fixes, flagged issues, and args into distinct sections. It is longer than typical, but most detail is relevant for a complex, multi-parameter repair tool; some fix-list wording could be tightened.

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?

Given nine parameters, no annotations, and an output schema, the description supplies the missing behavioral and parameter context an agent needs. It covers mutation safety, exact repair semantics, parameter defaults, and what is never changed.

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 description coverage is 0%, but the description documents all nine parameters in the Args section, including defaults and meaning for apply, strip_tags, max_line_length, max_cps, output, overwrite, encoding, and output_encoding. This fully compensates for the schema's lack of parameter descriptions.

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?

The first sentence states a specific verb and resource: repairing common damage in SRT/WebVTT files. The detailed fix list makes its scope clearer than the name alone, but it does not explicitly distinguish itself from sibling tools such as resync or convert.

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

Usage Guidelines3/5

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

It clearly explains the dry-run default and that apply=true is required to write changes, which is useful invocation guidance. However, it does not say when to choose this tool over siblings like resync, shift, or convert, leaving alternative routing implied rather than explicit.

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