Skip to main content
Glama

Write an SRT caption file

write_srt_file

Creates an .srt subtitle file from time-ordered start, end, and text segments, validating timing and optional overlaps before saving; use it to prepare captions for import into Premiere.

Instructions

Write an .srt subtitle file from a list of {start, end, text} segments (seconds). Segments must be in time order with end > start and must not overlap (allow_overlap=true permits overlaps). Nothing is written when a segment is invalid (BAD_ARGS). Writes the file directly; Premiere is not needed. Returns file_path, count, bytes, duration (end of the last caption) and readability warnings (as check_caption_readability). Fails with FILE_EXISTS if the file exists unless overwrite is true. Pass the file to import_captions_file to put it on a sequence.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>",
      "segments": "<segments>"
    },
    "name": "write_srt_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
segmentsYesThe captions in time order.
file_pathYesThe .srt file to write. Absolute path; missing folders are created.
overwriteNoReplace the file if it exists. Default false.
allow_overlapNoAllow a caption to start before the previous one ends. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing validation failure behavior ("Nothing is written when a segment is invalid (BAD_ARGS)"), the FILE_EXISTS error and overwrite escape hatch, and that missing folders are created. It also specifies the return payload (file_path, count, bytes, duration, readability warnings) in the absence of an output schema. The only mild tension is destructiveHint=false vs. overwrite=true replacing an existing file, but replacement is opt-in and off by default, so this is not a real contradiction.

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-loads what is produced and from what input, then layers validation, error behavior, return values and next step in ranked order. Every sentence carries actionable information with no filler or repetition of the title.

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 a mutation tool with no output schema, the description covers input constraints, atomicity, error codes, return fields, and the follow-up tool needed to actually use the file. An agent has everything required to invoke it correctly and handle failure.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters like file_path, overwrite, allow_overlap and the segment fields are already well documented in the schema. The description largely restates those same constraints (time order, end > start, overlap permission) rather than adding new format or edge-case detail, so it sits at the baseline.

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 output artifact ("Write an .srt subtitle file from a list of {start, end, text} segments") plus the input shape in seconds. This clearly separates it from parse_srt_file, shift_srt_file and srt_from_markers, which operate on existing or generated caption data.

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?

Provides a concrete downstream workflow ("Pass the file to import_captions_file to put it on a sequence") and clarifies that Premiere is not required, which tells the agent this is a standalone file-writing step. It does not explicitly contrast with srt_from_markers or parse_srt_file, so the 'when not to use' side is only implied.

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

Deploy Server

Other Tools