Skip to main content
Glama

Build Caption Artifact

build_caption_artifact

Builds SRT or VTT caption files from a word-timed transcript with balanced, sentence-aware cues, optional karaoke timestamps, emphasis, and speaker markup; returns text or writes to an approved workspace.

Instructions

Build a CapCut/Submagic-style SRT or VTT caption artifact from a caller-supplied word timeline: balanced word groups, sentence-aware breaks, min/max cue durations, optional karaoke word timestamps (VTT), emphasis and speaker markup. Local-only; returns the artifact inline or writes it inside an approved workspace and never changes Premiere.

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": {
      "word_timeline": "<word_timeline>",
      "format": "<format>"
    },
    "name": "build_caption_artifact"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatYesArtifact format. SRT uses HH:MM:SS,mmm; VTT starts with WEBVTT and uses HH:MM:SS.mmm.
karaokeNoVTT only: emit per-word <HH:MM:SS.mmm> timestamps inside each cue for word-highlight styles. Errors for SRT.
max_linesNoMaximum lines of plain caption text per cue (default 1); markup does not add lines.
uppercaseNoRender caption text in upper case.
output_pathNoOptional absolute file path to write the artifact to. Requires approved_workspace_path; the file must not already exist. When omitted the artifact text is returned inline (up to 512 KiB).
style_presetNoStyle descriptor to return with the artifact (default clean). Documentation only; not encoded in SRT/VTT.
strip_fillersNoTokens removed from the caption text (case-insensitive, punctuation ignored).
word_timelineYesCaller-supplied word-timed transcript for one Premiere source item. Words must be ordered by start time and bound to the transcript revision returned by get_clip_transcript_uxp. Different labeled speakers may overlap; same-speaker words may not, even when another speaker is between them.
words_per_cueNoTarget words per cue (default 4); sentences are split into balanced groups of at most this many words.
emphasis_wordsNoWords wrapped in <b> (SRT) or <c.emphasis> (VTT).
speaker_prefixNoPrefix cues with the speaker label when present: 'Speaker: ' in SRT, <v Speaker> in VTT.
idempotency_keyNoOptional client-chosen key (1-128 chars of A-Z a-z 0-9 . _ : -) for this intended edit. Pass a fresh key per edit and reuse it only when retrying that same edit, for example after a client-side timeout. A repeat with the same tool, key and arguments is not run again: while the first call is running it fails with IDEMPOTENCY_IN_PROGRESS (poll get_last_operations); after it finished it returns the original outcome marked replayed. A definite failure with nothing applied (receipt outcome not_applied) may be retried with the same key. Reusing a key with different arguments fails with IDEMPOTENCY_KEY_REUSED. Scoped to this MCP session (the stdio server process, or the HTTP server process when Streamable HTTP is stateless per request) and held in memory only (200 keys, 1 hour); it does not survive a restart or reconnect. Read-only invocations are never deduplicated.
max_cue_secondsNoMaximum cue duration (default 5).
min_cue_secondsNoMinimum cue duration (default 0.5); short cues are extended but never past the next cue start.
merge_gap_secondsNoExtend a cue to the next cue start when the gap is smaller than this (default 0.3) so captions do not flicker.
max_chars_per_lineNoMaximum characters per line of plain caption text (default 32); words are never split. Wrapping counts unescaped words only, so VTT escaping, karaoke timestamps, emphasis tags, and speaker prefixes can make the rendered line longer.
expected_cep_targetNoOptional reviewed CEP sequence/clip identity and exact tick ranges. Checked before every generated command; UXP refuses this CEP-only guard.
expected_project_pathNoOptional absolute saved-project path. Every generated CEP command refuses before its body when the active project differs or is unsaved. UXP commands refuse this CEP-only guard; local-only tools do not inspect Premiere. Omit to keep existing behavior.
approved_workspace_pathNoAbsolute existing directory that must contain output_path (checked via realpath of the parent directory). Required with output_path.

Output Schema

NameRequiredDescriptionDefault
okYesWhether the tool completed successfully.
dataNoTool-specific result data when ok is true; on failure, diagnostic detail when the tool provides it.
toolYesThe registered MCP tool name.
errorNoFailure detail when ok is false.
receiptNoVersioned common mutation receipt; success never implies rendered verification.
idempotencyNoPresent when idempotency_key deduplicated this call: replayed is true when the original outcome was returned instead of running again.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.30.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, openWorldHint=false, idempotentHint=false; the description adds genuinely new context that the tool is local-only, does not touch Premiere, and either returns text inline or writes into an approved workspace. It does not mention the idempotency/deduplication behavior or the inline size limit, though both appear in the schema.

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 dense sentences, capability list front-loaded, and the operational constraint (local-only, output modes) placed last where it belongs. No filler or restatement of the name.

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 19-parameter tool with nested objects, the description covers purpose, output modes, and the key non-mutation guarantee, and an output schema exists so return values need not be explained. Minor gaps: no mention of the workspace approval prerequisite or the idempotency key behavior, both left entirely to the schema.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description goes beyond by explaining the behavior behind parameters — sentence-split balanced groups, cue min/max duration constraints, VTT-only karaoke timestamps, and emphasis/speaker markup. It does not touch the workspace-path/expected-target guard parameters, which remain schema-only.

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 resource ('Build ... SRT or VTT caption artifact') and enumerates the concrete capabilities (balanced word groups, sentence-aware breaks, cue duration bounds, karaoke, emphasis/speaker markup). The 'local-only ... never changes Premiere' clause separates it from mutation siblings like create_caption_track without needing to name them.

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?

Clear context for when to use it: you have a caller-supplied word timeline bound to a transcript revision and want a caption file rather than a timeline edit. It does not explicitly name an alternative or state when-not-to-use, relying on inference from 'never changes Premiere'.

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