Skip to main content
Glama

ass_karaoke_generate

Generate karaoke timing tags for ASS subtitle lines by distributing durations across syllables using character, word, or marker modes.

Instructions

Generate \k tags across a line's syllables.

Arguments

selection / index Which lines to rewrite. index names one line; otherwise selection goes through :func:base.resolve_indices (None uses the session selection, and an error is raised when nothing is selected). start_ms / end_ms Span the durations are distributed over. When omitted the line's own Start/End are used. The line's own times are never modified by this tool (use :func:ass_karaoke_retime for that). mode marker / char / word / regex (pattern for regex). kind karaoke tag kind: k, kf, ko or kt. link how tags attach to the syllables: "none" one tag per syllable, placed before the syllable's own override tags; "syl" the same count but each tag is placed after the syllable's leading override tags; "char" one tag per visible character (combining marks stay with their base character) — the line span is split per character. weights "char" (visible length), "char_class" (CJK/Latin/space weighting, see karaoke.syllable_weights_by_char_class) or "even". replace_existing True (default) rewrites existing karaoke tags. False leaves any line that already carries karaoke tags untouched and reports it in skipped. min_cs minimum duration per syllable; a span too short to honour it raises :class:ToolError instead of silently producing zeros. snap_to_line Clamp an explicitly requested span to the line's own span when it would overshoot (reported in snapped).

Returns

{"text_source": "line", "doc_id", "mode", "kind", "link", "weights", "min_cs", "exact_sum_guaranteed": True, "sum_within_one_cs": True, "lines": [{"index", "start_ms", "end_ms", "span_ms", "span_cs", "snapped", "skipped", "reason", "durations_cs", "duration_sum_cs", "line_duration_cs", "discrepancy_cs", "matches_line_duration", "message", "syllables", "text", "old_text"}], "lines_changed": n}

The centisecond durations always sum to exactly span_cs (and therefore to the line duration when the span came from the line) — better than the one-centisecond tolerance required, so exact_sum_guaranteed is always True when a line is written.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNok
linkNonone
modeNomarker
indexNo
doc_idNo
end_msNo
markerNo|
min_csNo
patternNo
weightsNochar
start_msNo
selectionNo
snap_to_lineNo
replace_existingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so thoroughly: it discloses that line times are never modified, that replace_existing=True rewrites existing tags while False reports lines in 'skipped', that min_cs violation raises ToolError rather than producing zeros, and that snap_to_line clamping is reported in 'snapped'. These are real behavioral traits an agent needs and none of them come from structured fields.

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?

Front-loads the one-sentence purpose, then organizes the rest under clear Arguments/Returns headings with every parameter call-out earning its place. It is long, but the length is justified by 14 parameters and a missing output schema; density is appropriate rather than padded.

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?

No output schema exists, and the description supplies an explicit Returns shape plus the exact-sum guarantee semantics. Combined with the parameter coverage and mutation rules, an agent has everything required to invoke this complex 14-parameter tool correctly.

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 description coverage is 0% across 14 params, so the description must compensate, and it documents nearly all of them in prose (selection/index, start_ms/end_ms, mode, kind, link, weights, replace_existing, min_cs, snap_to_line) including allowed values for mode/kind/link/weights that the schema leaves un-enumerated. Only doc_id and marker are left undocumented, so it falls just short of fully covering the schema.

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 (Generate), a specific output artifact (\k tags), and a specific scope (a line's syllables). It also explicitly distinguishes itself from the sibling ass_karaoke_retime ('The line's own times are never modified by this tool'), so an agent can route correctly without opening another schema.

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?

Explains the line-selection contract (index names one line, otherwise selection via base.resolve_indices, None uses the session selection, error when nothing is selected) and points to ass_karaoke_retime for retiming. It stops short of contrasting against other karaoke siblings (auto_timings, set_timings, set_kind), so a 4 rather than a 5.

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