Skip to main content
Glama

ass_sort_lines

Sort selected ASS subtitle event lines in place by start, end, duration, style, actor, effect, layer, text, or comment, while keeping unselected lines at their original positions.

Instructions

Sort the selected lines in place (document.reorder_events).

Args: selection: selection spelling; None = every line. keys: sort keys, applied in order; defaults to ["start", "end"]. One of start, end, duration, style, actor/ name, effect, layer, text, comment. reverse: sort descending.

Only the selected lines move: they are re-shuffled among the slots they already occupy, so unselected lines keep their positions.

Returns {"doc_id", "sorted", "selection": [<0-based indices sorted>], "count", "moved": {old 0-based index: new 0-based index}}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysNo
doc_idNo
reverseNo
selectionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 this is an in-place mutation, that only selected lines are re-shuffled among their existing slots while unselected lines keep their positions, and it specifies the default key order and reverse semantics. It omits anything about undo behavior or failure modes, keeping it short of a 5.

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-loaded with the action, then a compact args block and one tight behavioral sentence. Slightly verbose with backtick-heavy formatting, but every sentence carries information.

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?

An output schema exists, so the return explanation is largely redundant, but the description still fully specifies the sorting semantics, key options, and in-place scoping needed for a 4-param mutation with no annotations. Only the doc_id parameter's meaning is absent.

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%, so the description must compensate. It documents three of four parameters in depth: selection (None = every line), keys (ordered list with the full set of allowed values), and reverse (descending). Only doc_id is left undocumented, a minor gap.

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 ('Sort the selected lines in place') and names the underlying operation. It is clearly distinguishable from siblings like ass_move_lines and ass_reorder_styles, which reorder rather than sort by keys.

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: sort the current selection, or every line when selection is None. There is no explicit when-to-use / when-not guidance nor a named alternative (e.g., ass_move_lines for manual ordering), leaving the agent to infer the routing.

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