Skip to main content
Glama

replace_props

Bulk find and replace property values across a subtree. Apply exact-match replacement rules to all descendants of a target node, returning per-rule match counts.

Instructions

Bulk find-and-replace property values across a subtree (target node + all descendants). Destructive batch mutation — no preview, no undo across many nodes. Returns per-rule match counts.

Use when:

  • Theming pass: change every #FFF fill to #000 across a screen

  • Token migration: bump every fontSize from 14 to 16

  • Normalizing values left inconsistent by earlier passes

  • The alternative is N targeted single-node calls (set_text / set_fill / edit)

Returns: { data: { replacements: [{ rule: 0, matched: 12 }, { rule: 1, matched: 0 }] } }

Parameters beyond schema:

  • node is the subtree root; search recurses into all descendants (depth-first).

  • Each rule's from is an EXACT-match string (no substring, no regex). For typed props (fontSize, opacity), pass values as strings — the executor coerces.

  • Zero matches do NOT error — they return matched: 0. Sanity-check with discover_props first if you're unsure values exist.

Skip when:

  • Updating a single known node — use set_text / set_fill / set_stroke / set_layout for type-aware single-intent edits, or edit for generic.

  • Values are variable-bound (tokens) — replace_props bypasses bindings; use bind_variable to swap the token instead.

  • You need partial / fuzzy match — replace_props is exact-only; you'll need find_nodes + a loop.

Examples: // single rule, white -> black replace_props({node: "1:2", rules: [{prop: "fillColor", from: "#FFF", to: "#000"}]})

// batch theme update — both rules applied in one pass replace_props({node: "1:2", rules: [ {prop: "fillColor", from: "#FFF", to: "#000"}, {prop: "fontSize", from: "14", to: "16"} ]})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesTarget node ID (e.g. "1:2")
rulesYesReplacement rules
Behavior5/5

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

No annotations exist, so description carries full burden. It discloses destructive nature (no preview/undo), exact-match behavior, no error on zero matches, and bypassing variable bindings.

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?

Description is lengthy but well-structured with sections, bullet points, and examples. Every sentence adds value; front-loaded purpose.

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?

Given no output schema, the description provides return format and match counts. It also suggests using discover_props for sanity checks, covering important context for a destructive batch tool.

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 covers 100% of parameters, but description adds meaning: node recursion, exact-match string, typed props as strings, batch application of rules, and examples.

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 clearly states the tool performs bulk find-and-replace on property values across a subtree, with specifics on being destructive and batch. It distinguishes from siblings like set_fill, set_text, and edit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly provides when to use (theming, token migration) and when to skip (single node, variable-bound values, fuzzy match), with alternative tools named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/musepy/genable'

If you have feedback or need assistance with the MCP directory API, please join our Discord server