Skip to main content
Glama

ass_find_replace

Replace literal text or regex matches across selected subtitle lines, with case, field, and limit controls; preview edits via dry run before snapshot-backed changes.

Instructions

Find and replace text across the selected lines.

Args: pattern: literal text (regex=False) or a Python regular expression (regex=True, compiled with re.UNICODE; back-references like \1 work in replacement). replacement: replacement string (used literally when regex=False). selection: selection spelling; None = every line. doc_id: document to edit; the current one when omitted. regex: treat pattern as a regular expression. case_sensitive: False makes the match case-insensitive. fields: which fields to touch; defaults to ["text"]. Any of text, start, end, style, actor/name, effect. dry_run: count only, change nothing. limit: stop after this many replacements in total.

Returns {"doc_id", "pattern", "replacement", "fields", "regex", "dry_run", "total": <replacements made>, "changed": [<0-based indices>], "lines": [{"index", "counts": {field: n}, "count", "text"}...], "limit"}. Snapshot-backed unless dry_run. Indices are 0-based.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
regexNo
doc_idNo
fieldsNo
dry_runNo
patternYes
selectionNo
replacementYes
case_sensitiveNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 behavioral burden. It usefully discloses that dry_run only counts changes, that edits are snapshot-backed unless dry_run, and that result indices are 0-based. It still does not cover failure modes, permission requirements, or all side effects of selecting fields like style/actor/effect.

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?

The description is front-loaded with purpose and organized into Args and Returns blocks, so it is easy to scan. It is somewhat long and includes return information that may partly duplicate the output schema, but most detail earns its place for a 9-parameter tool with no schema descriptions.

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 complex mutation tool with 9 parameters, no annotations, 0% schema coverage, and a large sibling set, the description supplies enough parameter and behavioral context to invoke it correctly. An output schema exists, so the return-value block is not strictly required, but the additional notes about snapshot backing and 0-based indices are useful.

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%, so the description must document all parameters. It does so thoroughly: pattern semantics with regex and back-references, replacement behavior, selection spelling, doc_id default, case sensitivity, allowed fields, dry_run behavior, and limit semantics.

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?

The description gives a precise verb+resource+scope: 'Find and replace text across the selected lines.' This distinguishes it from line-mutating siblings such as ass_update_line(s) and clearly indicates a search/replace operation over a selection or whole document.

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?

The description explains parameter-level choices (regex vs literal, selection None means all lines, omitted doc_id means current document), which implies usage. However, it does not explicitly name alternative tools or say when to prefer this over ass_update_lines, ass_update_line, or other bulk edit tools.

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