Skip to main content
Glama

Clean up captions

clean_captions

Cleans caption files by trimming whitespace, removing empty cues, sorting and merging duplicates, fixing timing overlaps/gaps, and renumbering; optionally strips sound tags and speaker labels.

Instructions

Automatic tidy-up: trims whitespace, drops empty and zero-length cues, sorts by time, merges back-to-back duplicates, fixes overlaps and flicker gaps, extends too-short cues where there is room, renumbers. Optionally removes sound descriptions like [MUSIC] or (laughs) and speaker labels.

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": "clean_captions"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoLocal caption file (.srt, .vtt, .ass/.ssa, .json). ~ is expanded.
formatNoInput format. Detected automatically when omitted.
contentNoCaption text, if you don't have a file.
overwriteNoAllow replacing an existing file.
min_gap_msNoMinimum gap between cues (83 ms ≈ 2 frames at 24 fps).
output_pathNoWrite the result here. Format follows the extension unless `to` is set. Omit to get the text back inline.
output_formatNoOutput format. Defaults to the input format (or the output_path extension).
min_duration_msNo
merge_duplicatesNo
remove_hearing_impairedNoStrip [SOUND], (sound), ♪ and 'SPEAKER:' labels.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare readOnly=false and destructive=false, and the description goes well beyond them by disclosing the actual content-mutating behaviors: merging back-to-back duplicates, extending too-short cues, dropping zero-length cues, and optionally stripping [MUSIC]/(laughs)/speaker labels. That is exactly the kind of semantic change an agent needs to know before running it. It stops short of mentioning that output may be written to a file or overwrite an existing one, which the schema covers.

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, front-loaded with the operation family followed by the opt-in exception. The long clause is a tight comma-separated list of distinct transforms rather than filler, and every item maps to a behavior the agent would otherwise have to guess.

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

Completeness4/5

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

For a 10-parameter, no-required-parameter tool with no output schema, the description covers the transformation semantics thoroughly. The remaining gap is modest: it does not state the return behavior (inline text versus written file) or the ordering/precedence of the fixes, both of which are partly handled by the schema's output_path description.

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?

At 80% schema coverage the baseline is 3, but the description adds real meaning to the undocumented parameters: 'fixes overlaps and flicker gaps' explains min_gap_ms, 'extends too-short cues where there is room' explains min_duration_ms, 'merges back-to-back duplicates' explains merge_duplicates, and 'removes sound descriptions... and speaker labels' explains remove_hearing_impaired. An agent can reason about the tunables without opening the schema.

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 description names a clear verb ('Automatic tidy-up') and enumerates the concrete transforms applied: whitespace trimming, dropping empty cues, time sorting, duplicate merging, overlap/flicker fixing, duration extension, and renumbering. That enumeration lets an agent distinguish it from diagnostic or structural siblings like lint_captions and reflow_captions, though 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 Guidelines3/5

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

Usage is implied rather than stated: the phrasing 'Automatic tidy-up' suggests a post-generation or pre-delivery repair pass, and the optional hearing-impaired removal is flagged as opt-in. There is no explicit when-to-use versus when-to-prefer lint_captions or retime_captions guidance, and no prerequisites are given.

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