figma_replace_repeated_with_component
Replaces repeated identical Figma nodes with instances of one master component after proving equivalence, with dry-run validation and transactional rollback on failure.
Instructions
Replace a repeated group of identical nodes with instances of one master component, in a single transactional call. Refuses to act unless every target is provably equivalent (COUNT_MISMATCH / TARGETS_NOT_EQUIVALENT / TARGETS_NOT_PROVABLE all abort with mutated:false). Verifies placement afterwards and rolls back on failure. Run with dryRun:true first.
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": {
"sourceId": "<sourceId>",
"componentKey": "<componentKey>"
},
"name": "figma_replace_repeated_with_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match | No | Selector for the cohort. Exact name+type only — no fuzzy matching. | |
| dryRun | No | Preview: resolves and validates, mutates nothing | |
| policy | No | strict | |
| fileKey | No | Which connected Figma file to use: its fileKey (figma_whoami) or, when omitted, the only connected file. Required once more than one file is connected; figma_ping lists them. | |
| preserve | No | ||
| sourceId | Yes | Canonical node; it is CLONED into a master, never mutated | |
| componentKey | Yes | Idempotency key; an existing master with this key is reused | |
| componentName | No | ||
| expectedCount | No | Abort if the selector matches a different number |