figma_patch
Apply keyed updates to a Figma design tree in one undo transaction. Run a dry-run diff first to preview create, update, and delete counts before writing.
Instructions
Update an existing keyed tree by stable key, in ONE transaction. A dry run is a real diff: it reports create/update/delete counts and a scope fingerprint without writing. Missing keys are refused unless allowCreate:true; a key that lives under a different parent is refused rather than duplicated; prune:true deletes keyed children omitted from the patch at each patched level. An SVG leaf keeps its frame id and key while a changed svg source replaces its interior. A BOOLEAN_OPERATION patch may list only the operands it changes when prune is false; pruning a boolean requires at least two operands in the patch. A sparse boolean patch keeps the existing operand order and appends a new operand; send the complete ordered list with prune:true to enforce order. Text updates load their fonts before writing, and any failure rolls the whole patch back. Target with rootNodeId, buildId or rootKey.
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": {
"patch": "<patch>"
},
"name": "figma_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | Sparse tree: only supplied properties are applied. Children are matched by key. | |
| prune | No | Delete keyed children omitted from the patch at each patched level | |
| dryRun | No | TRUE (default): diff only. FALSE: apply in one undo transaction. | |
| planId | No | ||
| buildId | No | The buildId stored on the root | |
| 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. | |
| rootKey | No | The stable key stored on the root | |
| rootNodeId | No | The built root, by id | |
| allowCreate | No | Create keys that are not present under the matched parent | |
| expectedFingerprint | No |