figma_create_nodes
Creates editable Figma layers from a JSON node array, supporting frames, shapes, text, SVG, components, images, and auto-layout with rollback on failure.
Instructions
Create editable layers from a JSON array (max 500 nodes). Each node: type FRAME|RECTANGLE|ELLIPSE|TEXT|SVG|COMPONENT|INSTANCE; optional key for returned ID map; name,x,y,width,height,fill/stroke (#RRGGBB or transparent),strokeWeight,opacity,radius,clipsContent. Frames/components: layout NONE|HORIZONTAL|VERTICAL,gap,padding or paddingTop/Bottom/Left/Right,primaryAlign MIN|CENTER|MAX|SPACE_BETWEEN,counterAlign MIN|CENTER|MAX,children. Sizing: horizontalSizing/verticalSizing FIXED|HUG|FILL, with FILL only inside auto-layout and HUG only text/auto-layout. Text: text,fontFamily,fontStyle,fontSize,lineHeight,letterSpacing,textAlign LEFT|CENTER|RIGHT; explicit width wraps text. SVG requires svg source. INSTANCE requires local componentId. Images: imageBase64 PNG/JPEG bytes. Nodes are parented before sizing. Entire creation is rolled back if it fails. Use fonts from figma_fonts; position new roots clear of existing content.
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": {
"targetDocumentId": "<targetDocumentId>",
"nodesJson": "<nodesJson>"
},
"name": "figma_create_nodes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | No | Page ID to select before running. | |
| parentId | No | ||
| nodesJson | Yes | ||
| targetDocumentId | Yes | documentId returned by figma_document; protects against editing a different file. |