Skip to main content
Glama

swap_color

Find and replace a color across an After Effects project, previewing matches with a dry run before applying swaps to solids, shape fills, strokes, text, or effect colors.

Instructions

Find/replace a color across the project — the client brand-color-change primitive. from/to accept a hex string ("#rrggbb"/"#rgb") or an [r,g,b(,a)] array (0–1 or 0–255, auto-normalized). A color matches when every RGB channel is within tolerance (0–1 per-channel, default 0.02) of from. dryRun defaults to TRUE — it reports every match WITHOUT changing anything; pass dryRun:false to apply. scope limits to one comp (name or id); omit for the whole project. include selects which color surfaces to touch (solids, shapeFill, shapeStroke, textFill, effectColor); omit for all. Setting a SOLID recolors every layer sharing that footage item (swapped once, flagged shared:true, called out in note). Keyframed colors are matched but SKIPPED (setValue would delete keys). Returns { from, to, tolerance, matches:[{comp, layer, surface, was, ...}], matchCount, swapped, dryRun, note? }.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "swap_color"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesReplacement color: hex or [r,g,b(,a)].
fromYesColor to find: hex or [r,g,b(,a)].
scopeNoComp (name, id, or { id: N }) to limit the swap to. Omit for whole project.
dryRunNoReport matches without changing (default true).
includeNoColor surfaces to include. Omit for all.
instanceNoTarget a specific AE when more than one is connected (e.g. "2026", "2025", or a major like "26"). Omit when only one AE is open — see list_instances.
toleranceNoPer-channel RGB match tolerance (0–1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description fully carries the behavioral burden. It prominently discloses the nonmutating default, the shared-footage side effect when changing a solid, and the fact that keyframed colors are matched but skipped to avoid deleting keys.

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 purpose and safe default are front-loaded, and nearly every sentence supplies information needed for correct invocation. The single dense paragraph is long and packs several behaviors together, so readability is slightly weaker than a more structured presentation.

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?

For a complex seven-parameter project-wide mutation, it covers matching, targeting, preview and application, important side effects and exclusions, and shared-item reporting. Because there is no output schema, the explicit return shape and match details are especially valuable and make the definition sufficiently complete.

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?

Although schema description coverage is 100%, the description adds substantial operational meaning: exact hex forms, array normalization across 0–1 and 0–255 ranges, the per-channel matching rule, and default tolerance behavior. It also clarifies omission semantics for scope and include and the practical consequences of dryRun.

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 opening phrase, "Find/replace a color across the project," gives a specific operation, resource, and scope, while "client brand-color-change primitive" clarifies the intended task. Details about solids, fills, strokes, text, and effects further distinguish it from general layer- or color-label tools.

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?

It provides a clear preview-versus-apply workflow: use the default dry run to inspect matches and pass dryRun:false to modify the project. It also explains when to use scope and include, but does not name an alternative for handling skipped keyframed colors or other cases outside its capabilities.

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