Skip to main content
Glama

Find & replace text

replace_text

Find and replace text in After Effects layer Source Text keyframes across one comp or all project comps. Use literal or regex matching, target layers, and dry-run to preview changes.

Instructions

Find and replace in text layers of one comp (comp given) or every comp in the project (comp omitted). Literal by default; regex=true enables JavaScript regex with $1 groups. Updates every Source Text keyframe. dryRun=true only reports matches.

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": {
      "find": "<find>"
    },
    "name": "replace_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
compNoComp name/id to search. Omit to search ALL comps in the project.
findYesText (or regex pattern) to find.
regexNoTreat 'find' as a regex.
dryRunNoReport what would change without changing anything.
layersNoOptional: only these layers (comp required).
replaceNoReplacement (default ''). With regex, $1.. refer to groups.
caseSensitiveNoCase-sensitive match (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing that the operation writes to every Source Text keyframe — a significant side effect an agent cannot infer from destructiveHint=false alone — and that dryRun only reports matches. The regex dialect (JavaScript, $1.. groups) is also disclosed. The annotations already declare the mutation and closed-world profile, so this is solid added context.

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?

Three compact sentences, zero filler, with scope first, matching mode second, and side effects/preview last. Every clause carries information an agent needs.

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?

Covers the essential call-shaping facts for a 7-parameter mutation tool: scope, literal vs. regex, keyframe-wide writes, and dry-run. Minor gaps remain — it does not say what dryRun returns (match count?) and never mentions the layers restriction, which matters for a project-wide replace.

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 coverage is 100%, so the baseline is 3. The description adds the meaningful detail that matching is literal unless regex=true and that the regex engine is JavaScript with $1 backreferences, but it leaves caseSensitive (default true) and the layers filter entirely to 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+resource ('find and replace in text layers') and immediately pins the scope with a parenthetical rule: one comp when comp is given, all comps when omitted. That scope distinction separates it from single-value setters like set_text_content without the agent needing to open 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?

Gives clear conditional usage (provide comp vs. omit comp) and names the preview path via dryRun=true. It does not name an alternative sibling or state when not to use it (e.g., use set_text_content for wholesale replacement), so it stops short of full routing guidance.

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