Skip to main content
Glama

merge_or_split

Combine two subtitle files with an optional time offset, or cut one at a specific time into two re-zeroed parts for SRT and WebVTT.

Instructions

Join two subtitle files or cut one in two. SRT and WebVTT only.

mode='merge': the cues of path2 are moved by offset_ms and combined with those of path (result sorted by start time, in the format of the first file). If offset_ms is omitted, the second file is placed right after the last cue of the first (typical for CD1 + CD2 rips). Use offset_ms=0 to overlay two files, such as two languages.

mode='split': cut at time at. Part 1 holds everything that starts before at; part 2 holds everything from at on, re-zeroed so at becomes 00:00:00. A cue that straddles the cut appears in both parts (clipped to the cut in part 1).

Args: path: first (or only) file. mode: 'merge' or 'split'. path2: second file (merge only). offset_ms: milliseconds added to every cue of path2 (merge only; may be negative). at: split time such as 00:45:10,000 (split only). output: merged file / first part (default .merged. or .part1.). output2: second part (split only, default .part2.). overwrite: allow replacing existing output files (default false). encoding: force the input text encoding (applies to both inputs). output_encoding: encoding of the written files (default utf-8).

Input Schema

NameRequiredDescriptionDefault
atNo
modeYes
pathYes
path2No
outputNo
output2No
encodingNo
offset_msNo
overwriteNo
output_encodingNoutf-8

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/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 merge sorts by start time and adopts the first file's format, that split re-zeroes part 2 to 00:00:00, that a straddling cue is duplicated and clipped, and that overwrite defaults to false. Gaps remain on failure behavior (what happens when outputs exist and overwrite is false) and whether the two inputs must share a format or encoding.

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?

Front-loaded with the one-line purpose, then per-mode semantics, then a compact Args list. Every sentence adds operational information and the mode-specific scoping ('merge only', 'split only') is stated inline rather than left implicit.

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?

Return values need not be explained because an output schema exists, and the description covers both modes plus every parameter for a 10-param, annotation-free tool. It is only slightly short of complete: format/encoding compatibility between the two merge inputs and the existing-file error path are unstated.

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%, yet the Args block documents all ten parameters with meaning the schema cannot convey: offset_ms may be negative and applies only to path2, `at` uses the 00:45:10,000 format, output/output2 have concrete default filenames, and encoding applies to both inputs while output_encoding governs the writes.

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 compound verb and resource ('Join two subtitle files or cut one in two') plus the supported formats (SRT and WebVTT only). The two named modes map exactly onto the two operations, so an agent can tell this apart from siblings like shift, 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 Guidelines4/5

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

Gives explicit when-to-use guidance per mode: merge with omitted offset_ms for CD1+CD2 rips, offset_ms=0 to overlay two languages, split with `at` for cutting. It does not state when NOT to use this tool versus siblings (e.g. use shift for single-file retiming, convert for format changes), which is the only missing routing signal.

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