@ufira/vibma 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,15 +89,15 @@ Use help(topic: "<endpoint>") for endpoint details.
89
89
  Use help(topic: "<endpoint>.<method>") for method details.`;
90
90
  var helpEndpoints = {
91
91
  "annotations": {
92
- "summary": '# annotations\nRead and manage design annotations and annotation categories.\n\nMethods:\n get Read all annotations on a node (full detail with resolved category names) [read]\n list Search annotations across a subtree, optionally filtered by category [read]\n set Replace all annotations on a node [edit]\n add Add an annotation to a node [edit]\n remove Remove an annotation from a node by index [edit]\n categories List all annotation categories in the file [read]\n create_category Create a new annotation category [create]\n update_category Update an annotation category\'s label or color [edit]\n delete_category Delete an annotation category [edit]\n\n// Annotations are designer-authored notes attached to nodes \u2014 specs, intent, constraints.\n// Every node-returning endpoint includes an annotation brief: { label, properties?, categoryId? }.\n// Use this endpoint for full CRUD and to manage annotation categories.\n// Workflow: read annotations on a node with get, add new ones with add, manage categories with categories/create_category.\n// Batch: get/set/add/remove accept items:[{id, ...}] for multi-node operations, or single-item params (id, label, etc).\n// properties: measurement indicators Figma displays on the canvas \u2014 validated per node type and state.\n// labelMarkdown: rich text label supporting **bold**, *italic*, `code`, [links](url).\n// categoryId: group annotations by category (e.g. "Spacing", "Typography"). Create categories first.\n// ---\n// AnnotationPropertyType values (node-type-dependent \u2014 invalid ones are rejected with the available list):\n// Dimension: width, height, maxWidth, minWidth, maxHeight, minHeight\n// Paint: fills, strokes, effects, strokeWeight, cornerRadius, opacity\n// Text (TEXT nodes only): textStyleId, textAlignHorizontal, fontFamily, fontStyle, fontSize, fontWeight, lineHeight, letterSpacing\n// Layout (auto-layout only): itemSpacing, padding, layoutMode, alignItems\n// Instance (INSTANCE only): mainComponent\n// Grid (grid layout only): gridRowGap, gridColumnGap, gridRowCount, gridColumnCount, gridRowAnchorIndex, gridColumnAnchorIndex, gridRowSpan, gridColumnSpan\n// AnnotationCategoryColor values: yellow, orange, red, pink, violet, blue, teal, green.\n\nUse annotations(method: "help", topic: "<method>") for method details.',
92
+ "summary": '# annotations\nRead and manage design annotations and annotation categories.\n\nMethods:\n get Read all annotations on a node (full detail with resolved category names) [read]\n list Search annotations across a subtree, optionally filtered by category [read]\n set Replace all annotations on a node [edit]\n add Add an annotation to a node [edit]\n remove Remove an annotation from a node by index [edit]\n categories List all annotation categories in the file [read]\n create_category Create a new annotation category [create]\n update_category Update an annotation category\'s label or color [edit]\n delete_category Delete an annotation category [edit]\n\n// Annotations are designer-authored notes attached to nodes \u2014 specs, intent, constraints.\n// Every node-returning endpoint includes an annotation brief: { label, properties?, categoryId? }.\n// Use this endpoint for full CRUD and to manage annotation categories.\n// Workflow: read annotations on a node with get, add new ones with add, manage categories with categories/create_category.\n// Batch: get/set/add/remove accept items:[{id, ...}] for multi-node operations, or single-item params (id, label, etc).\n// properties: measurement indicators Figma displays on the canvas \u2014 validated per node type and state.\n// labelMarkdown: rich text label supporting **bold**, *italic*, `code`, [links](url).\n// categoryId: group annotations by category (e.g. "Spacing", "Typography"). Create categories first.\n// ---\n// AnnotationPropertyType values (node-type-dependent \u2014 invalid ones are rejected with the available list):\n// Dimension: width, height, maxWidth, minWidth, maxHeight, minHeight\n// Paint: fills, strokes, effects, strokeWeight, cornerRadius, opacity\n// Text (TEXT nodes only): textStyleId, textAlignHorizontal, fontFamily, fontStyle, fontSize, fontWeight, lineHeight, letterSpacing\n// Layout (auto-layout only): itemSpacing, padding, layoutMode, alignItems\n// Instance (INSTANCE only): mainComponent\n// Grid (grid layout only): gridRowGap, gridColumnGap, gridRowCount, gridColumnCount, gridRowAnchorIndex, gridColumnAnchorIndex, gridRowSpan, gridColumnSpan\n// AnnotationCategoryColor values: yellow, orange, red, pink, violet, blue, teal, green.\n\nUse annotations(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.',
93
93
  "methods": {
94
- "get": '# annotations.get\nRead all annotations on a node (full detail with resolved category names)\n\nExample: annotations(method:"get", id:"1:23")\n\nParams:\n id (string, optional) \u2014 Node ID\n categoryId (string, optional) \u2014 Filter \u2014 only return annotations in this category\n items (array, optional) \u2014 Batch: [{id, categoryId?}, ...]\n id (string, required)\n categoryId (string, optional)',
95
- "list": '# annotations.list\nSearch annotations across a subtree, optionally filtered by category\n\nExample: annotations(method:"list", parentId:"1:2", categoryId:"113:0")\n\nParams:\n parentId (string, optional) \u2014 Root node to search within (default: current page)\n categoryId (string, optional) \u2014 Filter by category ID\n limit (number, optional) \u2014 Max items per page (default 100)',
96
- "set": '# annotations.set\nReplace all annotations on a node\n\nExample: annotations(method:"set", id:"1:23", annotations:[{label:"Spacing: 16px", properties:["padding"]}])\n\nParams:\n id (string, optional) \u2014 Node ID\n annotations (array, optional) \u2014 Array of annotation objects to set (replaces all existing)\n label (string, optional) \u2014 Plain text label\n labelMarkdown (string, optional) \u2014 Rich text label (Markdown)\n properties (string[], optional) \u2014 Measurement property types to display\n categoryId (string, optional) \u2014 Category ID\n items (array, optional) \u2014 Batch: [{id, annotations: [...]}, ...]\n id (string, required)\n annotations (array, required) \u2014 Annotations to set on this node',
97
- "add": '# annotations.add\nAdd an annotation to a node\n\nExample: annotations(method:"add", id:"1:23", labelMarkdown:"**Width**: 320px fixed", properties:["width"])\n\nParams:\n id (string, optional) \u2014 Node ID\n label (string, optional) \u2014 Plain text label (use label or labelMarkdown, not both)\n labelMarkdown (string, optional) \u2014 Rich text label with Markdown formatting\n properties (string[], optional) \u2014 Measurement property types to display on canvas\n categoryId (string, optional) \u2014 Category ID to group this annotation\n items (array, optional) \u2014 Batch: [{id, label?, labelMarkdown?, properties?, categoryId?}, ...]\n id (string, required)\n label (string, optional)\n labelMarkdown (string, optional)\n properties (string[], optional)\n categoryId (string, optional)',
98
- "remove": '# annotations.remove\nRemove an annotation from a node by index\n\nExample: annotations(method:"remove", id:"1:23", index:0)\n\nParams:\n id (string, optional) \u2014 Node ID\n index (number, optional) \u2014 Annotation index to remove (from get response)\n items (array, optional) \u2014 Batch: [{id, index}, ...]\n id (string, required)\n index (number, required)',
99
- "categories": '# annotations.categories\nList all annotation categories in the file\n\nExample: annotations(method:"categories")\n\nNo params.',
100
- "create_category": '# annotations.create_category\nCreate a new annotation category\n\nExample: annotations(method:"create_category", label:"Spacing", color:"blue")\n\nParams:\n label (string, required) \u2014 Category label\n color (yellow | orange | red | pink | violet | blue | teal | green, required) \u2014 Category color',
94
+ "get": '# annotations.get\nRead all annotations on a node (full detail with resolved category names)\n\nExample: annotations(method:"get", id:"1:23")\n\nParams:\n id (string, optional) \u2014 Node ID\n categoryId (string, optional) \u2014 Filter \u2014 only return annotations in this category\n items (array, optional) \u2014 Batch: [{id, categoryId?}, ...]\n id (string, required)\n categoryId (string, optional)\n\nResponse:\n { results: ({id} | {error})[] }',
95
+ "list": '# annotations.list\nSearch annotations across a subtree, optionally filtered by category\n\nExample: annotations(method:"list", parentId:"1:2", categoryId:"113:0")\n\nParams:\n parentId (string, optional) \u2014 Root node to search within (default: current page)\n categoryId (string, optional) \u2014 Filter by category ID\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n results (array, optional) \u2014 Annotations found across the subtree\n nodeId (string, optional)\n nodeName (string, optional)\n nodeType (string, optional)\n index (number, optional)\n label (string, optional)\n labelMarkdown (string, optional)\n properties (array, optional)\n category (object, optional)\n count (number, optional)\n _truncated (boolean, optional)',
96
+ "set": '# annotations.set\nReplace all annotations on a node\n\nExample: annotations(method:"set", id:"1:23", annotations:[{label:"Spacing: 16px", properties:["padding"]}])\n\nParams:\n id (string, optional) \u2014 Node ID\n annotations (array, optional) \u2014 Array of annotation objects to set (replaces all existing)\n label (string, optional) \u2014 Plain text label\n labelMarkdown (string, optional) \u2014 Rich text label (Markdown)\n properties (string[], optional) \u2014 Measurement property types to display\n categoryId (string, optional) \u2014 Category ID\n items (array, optional) \u2014 Batch: [{id, annotations: [...]}, ...]\n id (string, required)\n annotations (array, required) \u2014 Annotations to set on this node\n\nResponse:\n { results: ({id} | {error})[] }',
97
+ "add": '# annotations.add\nAdd an annotation to a node\n\nExample: annotations(method:"add", id:"1:23", labelMarkdown:"**Width**: 320px fixed", properties:["width"])\n\nParams:\n id (string, optional) \u2014 Node ID\n label (string, optional) \u2014 Plain text label (use label or labelMarkdown, not both)\n labelMarkdown (string, optional) \u2014 Rich text label with Markdown formatting\n properties (string[], optional) \u2014 Measurement property types to display on canvas\n categoryId (string, optional) \u2014 Category ID to group this annotation\n items (array, optional) \u2014 Batch: [{id, label?, labelMarkdown?, properties?, categoryId?}, ...]\n id (string, required)\n label (string, optional)\n labelMarkdown (string, optional)\n properties (string[], optional)\n categoryId (string, optional)\n\nResponse:\n { results: ({id} | {error})[] }',
98
+ "remove": '# annotations.remove\nRemove an annotation from a node by index\n\nExample: annotations(method:"remove", id:"1:23", index:0)\n\nParams:\n id (string, optional) \u2014 Node ID\n index (number, optional) \u2014 Annotation index to remove (from get response)\n items (array, optional) \u2014 Batch: [{id, index}, ...]\n id (string, required)\n index (number, required)\n\nResponse:\n { results: ({id} | {error})[] }',
99
+ "categories": '# annotations.categories\nList all annotation categories in the file\n\nExample: annotations(method:"categories")\n\nNo params.\n\nResponse:\n categories (array, optional)\n id (string, optional)\n label (string, optional)\n color (string, optional)\n isPreset (boolean, optional)',
100
+ "create_category": '# annotations.create_category\nCreate a new annotation category\n\nExample: annotations(method:"create_category", label:"Spacing", color:"blue")\n\nParams:\n label (string, required) \u2014 Category label\n color (yellow | orange | red | pink | violet | blue | teal | green, required) \u2014 Category color\n\nResponse:\n id (string, optional)\n label (string, optional)\n color (string, optional)',
101
101
  "update_category": `# annotations.update_category
102
102
  Update an annotation category's label or color
103
103
 
@@ -106,14 +106,33 @@ Example: annotations(method:"update_category", id:"cat:123", label:"Layout", col
106
106
  Params:
107
107
  id (string, required) \u2014 Category ID
108
108
  label (string, optional) \u2014 New label
109
- color (yellow | orange | red | pink | violet | blue | teal | green, optional) \u2014 New color`,
110
- "delete_category": '# annotations.delete_category\nDelete an annotation category\n\nExample: annotations(method:"delete_category", id:"cat:123")\n\nParams:\n id (string, required) \u2014 Category ID to delete'
109
+ color (yellow | orange | red | pink | violet | blue | teal | green, optional) \u2014 New color
110
+
111
+ Response:
112
+ id (string, optional)
113
+ label (string, optional)
114
+ color (string, optional)`,
115
+ "delete_category": '# annotations.delete_category\nDelete an annotation category\n\nExample: annotations(method:"delete_category", id:"cat:123")\n\nParams:\n id (string, required) \u2014 Category ID to delete\n\nResponse:\n deleted (boolean, optional)'
111
116
  }
112
117
  },
113
118
  "components": {
114
- "summary": '# components\nCreate and manage reusable components and variant sets.\n\nMethods:\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n list List local component names (variant sets as single entries) [read]\n get Get component detail \u2014 property definitions + optional node tree for structural inspection [read]\n create Create components [create]\n commit Commit a staged component \u2014 unwraps from [STAGED] container into the original target location. [edit]\n update Add, edit, or delete component properties [edit]\n delete Delete components or component sets [edit]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// properties: escape hatch \u2014 set any Figma node property directly. Use only when no dedicated field exists.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}}\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.\n// Unknown keys produce a warning, preventing silent failures.\n// Components are reusable design elements. Instances stay linked to the component and inherit changes.\n// Workflow: create component (with properties) \u2192 add children \u2192 create instances via instances.create.\n// ---\n// A component set (variant set) groups related components as variants (e.g. Button/Primary, Button/Secondary).\n// Property types: BOOLEAN (toggle visibility), TEXT (editable text), INSTANCE_SWAP (swap child instance), VARIANT (variant picker).\n// exposeText: when creating from_node, text children become editable TEXT properties on the component.\n// Auto-bind: TEXT properties auto-bind to text children with matching names (case-insensitive).\n// Example: properties:[{propertyName:"Label", type:"TEXT", defaultValue:"Click"}] binds to a child text node named "Label".\n// text.create accepts componentPropertyName to bind on creation \u2014 walks up ancestors to find the nearest component.\n// For nested text (text inside frames inside a component), componentPropertyName resolves via ancestor walk. Alternatively, pass componentId explicitly.\n// For existing nodes with many text children, prefer components(method:"create", type:"from_node", exposeText:true) \u2014 it auto-discovers, creates TEXT properties, and binds all text nodes in one operation.\n// Property keys: read returns clean names ("Label"), write requires the #suffix ("Label#1:0"). Call components.get(id) to discover exact keys before edit/delete.\n// ComponentItem accepts the same params as FrameItem (layout, fill, stroke, sizing, min/max).\n// A component IS a frame \u2014 create it directly with all layout properties, then add children.\n// SIZING: Components with text need a width constraint \u2014 set width + layoutSizingHorizontal:"FIXED".\n// Without it, text won\'t wrap and the component grows unboundedly.\n// HUG on both axes is only correct for intrinsically-sized elements (buttons, badges, icons).\n// action: "add" (default) \u2014 requires type + defaultValue. "edit" \u2014 pass defaultValue to change value, name to rename property. "delete" \u2014 just propertyName#suffix.\n// action: "rename_variant" \u2014 renames a variant option VALUE (not the property). Pass defaultValue=current option name, name=new option name.\n// For VARIANT properties: "edit" with defaultValue reorders children to set the default variant.\n// Adding variants: clone an existing variant into the set with a new name. See guidelines(topic:"component-structure") for workflow.\n\nUse components(method: "help", topic: "<method>") for method details.',
119
+ "summary": '# components\nCreate and manage reusable components and variant sets.\n\nMethods:\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n scale Proportionally rescale a node subtree using Figma\'s visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing. [edit]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n list List local component names (variant sets as single entries) [read]\n get Get component detail \u2014 property definitions + optional node tree for structural inspection [read]\n create Create components [create]\n commit Commit a staged component \u2014 unwraps from [STAGED] container into the original target location. [edit]\n update Add, edit, or delete component properties [edit]\n delete Delete components or component sets [edit]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// clipsContent: clip children to the node bounds where supported (frames/components/instances). Set false for overflow-visible layouts.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // readback Paint[]; authoring supports SOLID + gradients via gradientTransform + gradientStops\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create. Paint[] authoring supports SOLID + gradients only; IMAGE/VIDEO/PATTERN are readback-only metadata.\n// Unknown keys produce a warning, preventing silent failures.\n// Components are reusable design elements. Instances stay linked to the component and inherit changes.\n// Workflow: create component (with properties) \u2192 add children \u2192 create instances via instances.create.\n// ---\n// A component set (variant set) groups related components as variants (e.g. Button/Primary, Button/Secondary).\n// Property types: BOOLEAN (toggle visibility), TEXT (editable text), INSTANCE_SWAP (swap child instance), VARIANT (variant picker).\n// exposeText: when creating from_node, text children become editable TEXT properties on the component.\n// Auto-bind: TEXT properties auto-bind to text children with matching names (case-insensitive).\n// Example: properties:[{propertyName:"Label", type:"TEXT", defaultValue:"Click"}] binds to a child text node named "Label".\n// text.create accepts componentPropertyName to bind on creation \u2014 walks up ancestors to find the nearest component.\n// For nested text (text inside frames inside a component), componentPropertyName resolves via ancestor walk. Alternatively, pass componentId explicitly.\n// For existing nodes with many text children, prefer components(method:"create", type:"from_node", exposeText:true) \u2014 it auto-discovers, creates TEXT properties, and binds all text nodes in one operation.\n// Property keys: read returns clean names ("Label"), write requires the #suffix ("Label#1:0"). Call components.get(id) to discover exact keys before edit/delete.\n// ComponentItem accepts the same params as FrameItem (layout, fill, stroke, sizing, min/max).\n// A component IS a frame \u2014 create it directly with all layout properties, then add children.\n// Examples assume design tokens/styles already exist. Build components from tokens/styles, not raw color/spacing/type values.\n// SIZING: Components with text need a width constraint \u2014 set width + layoutSizingHorizontal:"FIXED".\n// Without it, text won\'t wrap and the component grows unboundedly.\n// HUG on both axes is only correct for intrinsically-sized elements (buttons, badges, icons).\n// action: "add" (default) \u2014 requires type + defaultValue. "edit" \u2014 pass defaultValue to change value, name to rename property. "delete" \u2014 just propertyName#suffix.\n// action: "rename_variant" \u2014 renames a variant option VALUE (not the property). Pass defaultValue=current option name, name=new option name.\n// For VARIANT properties: "edit" with defaultValue reorders children to set the default variant.\n// Adding variants: clone an existing variant into the set with a new name. See guidelines(topic:"component-structure") for workflow.\n\nUse components(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// NodeStub: {id: string, name: string, type: string}',
115
120
  "methods": {
116
- "clone": "# components.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
121
+ "clone": "# components.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n\nResponse:\n { results: ({id} | {error})[] }",
122
+ "scale": `# components.scale
123
+ Proportionally rescale a node subtree using Figma's visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing.
124
+
125
+ Example: components(method:"scale", id:"1:23", factor:0.5)
126
+
127
+ Params:
128
+ id (string, optional) \u2014 Node ID to scale
129
+ factor (number, optional) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%. Scales children, text, strokes, effects, and layout geometry from the node's top-left. On auto-layout or HUG/FILL nodes, Figma may resolve responsive sizing to fixed width/height.
130
+ items (array, optional) \u2014 Batch: [{id, factor}, ...]. Alternative to single-item params.
131
+ id (string, required) \u2014 Node ID to scale
132
+ factor (number, required) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%.
133
+
134
+ Response:
135
+ { results: ("ok" | {error})[] }`,
117
136
  "audit": `# components.audit
118
137
  Run lint on a node \u2014 returns severity-ranked findings
119
138
 
@@ -123,189 +142,216 @@ Params:
123
142
  maxDepth (number, optional) \u2014 Max tree depth (default: 10)
124
143
  maxFindings (number, optional) \u2014 Max findings (default: 50)
125
144
  minSeverity (error | unsafe | heuristic | style | verbose, optional) \u2014 Minimum severity to report (default: style). Set to 'verbose' to include AAA contrast and line-height checks.
126
- skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
127
- "reparent": "# components.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)",
128
- "list": "# components.list\nList local component names (variant sets as single entries)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)",
129
- "get": "# components.get\nGet component detail \u2014 property definitions + optional node tree for structural inspection\n\nParams:\n id (string, optional) \u2014 Component or component set ID\n names (string[], optional) \u2014 Batch lookup by name (case-insensitive). Either id or names is required.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.",
145
+ skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)
146
+
147
+ Response:
148
+ nodeId (string, optional)
149
+ nodeName (string, optional)
150
+ categories (array, optional) \u2014 Sorted by severity (error > unsafe > heuristic > style)`,
151
+ "reparent": '# components.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
152
+ "list": "# components.list\nList local component names (variant sets as single entries)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n totalCount (number, required)\n returned (number, optional)\n offset (number, optional)\n limit (number, optional)\n items (array, required)",
153
+ "get": "# components.get\nGet component detail \u2014 property definitions + optional node tree for structural inspection\n\nParams:\n id (string, optional) \u2014 Component or component set ID\n names (string[], optional) \u2014 Batch lookup by name (case-insensitive). Either id or names is required.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.\n\nResponse:\n results (array, required) \u2014 Component summaries (without depth) or full node trees with properties merged (with depth)\n id (string, optional)\n name (string, optional)\n description (string, optional)\n properties (object, optional) \u2014 Property definitions \u2014 {name: {type, defaultValue, options?}}\n _truncated (boolean, optional)",
130
154
  "create": `# components.create
131
155
  Create components
132
156
 
133
- Example: components(method:"create", type:"component", items:[{name:"Card", layoutMode:"VERTICAL", padding:"16", itemSpacing:"8", fillVariableName:"bg/surface", children:[{type:"text", text:"Title", componentPropertyName:"Title"}, {type:"text", text:"Description", fontSize:14, componentPropertyName:"Description"}], properties:[{propertyName:"Show Icon", type:"BOOLEAN", defaultValue:true}]}])
157
+ Call shape: components(method:"create", type:"<type>", items:[{...type-specific fields...}])
158
+ Do not pass type-specific item fields at the top level; put them inside items[].
134
159
 
135
160
  Discriminant: type (component | from_node | variant_set)
161
+ Top-level params:
162
+ type (component | from_node | variant_set, required) \u2014 Selects which item shape to use
163
+ items (array, required) \u2014 One or more type-specific item objects
136
164
 
137
165
  ## component \u2014 Create component with full frame properties (layout, fill, stroke, sizing). A component IS a frame \u2014 build directly, no need to create a frame first.
138
- name (string, required) \u2014 Component name
139
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
140
- x (number, optional) \u2014 X position (default: 0)
141
- y (number, optional) \u2014 Y position (default: 0)
142
- width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
143
- height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
144
- rotation (number, optional) \u2014 Rotation in degrees (0-360)
145
- visible (boolean, optional) \u2014 Show/hide (default true)
146
- locked (boolean, optional) \u2014 Lock/unlock (default false)
147
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
148
- blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
149
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
150
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
151
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
152
- fillStyleName (string, optional) \u2014 Paint style name for fill
153
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
154
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
155
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
156
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
157
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
158
- strokeStyleName (string, optional) \u2014 Paint style name for stroke
159
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
160
- strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
161
- strokeTopWeight (string, optional)
162
- strokeBottomWeight (string, optional)
163
- strokeLeftWeight (string, optional)
164
- strokeRightWeight (string, optional)
165
- strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
166
- cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
167
- topLeftRadius (string, optional)
168
- topRightRadius (string, optional)
169
- bottomRightRadius (string, optional)
170
- bottomLeftRadius (string, optional)
171
- layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
172
- layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
173
- padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
174
- paddingTop (string, optional)
175
- paddingRight (string, optional)
176
- paddingBottom (string, optional)
177
- paddingLeft (string, optional)
178
- primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
179
- counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
180
- itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
181
- counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
182
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
183
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
184
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
185
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
186
- layoutSizingVertical (FIXED | HUG | FILL, optional)
187
- minWidth (number, optional) \u2014 Min width for responsive auto-layout
188
- maxWidth (number, optional) \u2014 Max width for responsive auto-layout
189
- minHeight (number, optional) \u2014 Min height for responsive auto-layout
190
- maxHeight (number, optional) \u2014 Max height for responsive auto-layout
191
- annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
192
- description (string, optional) \u2014 Component description (shown in Figma's component panel)
193
- children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, componentPropertyName?, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, componentPropertyName?, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. componentPropertyName auto-creates and binds a TEXT (text) or INSTANCE_SWAP (instance) property. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Label", componentPropertyName:"Label", fontSize:14, fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Actions", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", componentPropertyName:"Action", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}]
194
-
195
- properties (array, optional) \u2014 Component properties to define at creation: [{propertyName, type, defaultValue}]. TEXT properties for inline children with componentPropertyName are created automatically.
196
- propertyName (string, required) \u2014 Property name
197
- type (BOOLEAN | TEXT | INSTANCE_SWAP, required) \u2014 Property type
198
- defaultValue (string_or_boolean, required) \u2014 Default value
199
- preferredValues (array, optional) \u2014 Preferred values for INSTANCE_SWAP
166
+ Example: components(method:"create", type:"component", items:[{name:"Card", width:320, height:200, layoutMode:"VERTICAL", padding:"space/16", itemSpacing:"space/8", fillVariableName:"bg/surface", strokeVariableName:"border/subtle", strokeWeight:"stroke/1", cornerRadius:"radius/12", children:[{type:"text", name:"Title", text:"Title", componentPropertyName:"Title", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}])
167
+ Item fields for items[] when type:"component":
168
+ name (string, required) \u2014 Component name
169
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
170
+ x (number, optional) \u2014 X position (default: 0)
171
+ y (number, optional) \u2014 Y position (default: 0)
172
+ width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
173
+ height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
174
+ rotation (number, optional) \u2014 Rotation in degrees (0-360)
175
+ visible (boolean, optional) \u2014 Show/hide (default true)
176
+ locked (boolean, optional) \u2014 Lock/unlock (default false)
177
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
178
+ blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
179
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
180
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
181
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
182
+ fillStyleName (string, optional) \u2014 Paint style name for fill
183
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
184
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
185
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
186
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
187
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
188
+ strokeStyleName (string, optional) \u2014 Paint style name for stroke
189
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
190
+ strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
191
+ strokeTopWeight (string, optional)
192
+ strokeBottomWeight (string, optional)
193
+ strokeLeftWeight (string, optional)
194
+ strokeRightWeight (string, optional)
195
+ strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
196
+ cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
197
+ topLeftRadius (string, optional)
198
+ topRightRadius (string, optional)
199
+ bottomRightRadius (string, optional)
200
+ bottomLeftRadius (string, optional)
201
+ layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
202
+ layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
203
+ padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
204
+ paddingTop (string, optional)
205
+ paddingRight (string, optional)
206
+ paddingBottom (string, optional)
207
+ paddingLeft (string, optional)
208
+ primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
209
+ counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
210
+ itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
211
+ counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
212
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
213
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
214
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
215
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
216
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
217
+ minWidth (number, optional) \u2014 Min width for responsive auto-layout
218
+ maxWidth (number, optional) \u2014 Max width for responsive auto-layout
219
+ minHeight (number, optional) \u2014 Min height for responsive auto-layout
220
+ maxHeight (number, optional) \u2014 Max height for responsive auto-layout
221
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
222
+ description (string, optional) \u2014 Component description (shown in Figma's component panel)
223
+ children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, componentPropertyName?, textStyleName?, fontColorVariableName?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillVariableName?, itemSpacing?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, componentPropertyName?, variantProperties?, properties?}. component: {type:"component", name, children?}. rectangle / ellipse / line: same params as the corresponding frames(method:"create", type:"rectangle"|"ellipse"|"line") branch. All params from text/frame endpoints are supported on their respective types. Inline fills/strokes accept Paint[] authoring input: SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. Do not use CSS gradients, REST gradientHandlePositions, or IMAGE/VIDEO/PATTERN in Paint[] authoring. componentPropertyName auto-creates and binds a TEXT (text) or INSTANCE_SWAP (instance) property. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"ellipse", name:"Dot", width:6, height:6, fillVariableName:"status/active"}, {type:"text", name:"Label", text:"Button", componentPropertyName:"Label", textStyleName:"Body/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Actions", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:"space/8", children:[{type:"instance", componentId:"1:2", componentPropertyName:"Action", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}]
224
+
225
+ properties (array, optional) \u2014 Component properties to define at creation: [{propertyName, type, defaultValue}]. TEXT properties for inline children with componentPropertyName are created automatically.
226
+ propertyName (string, required) \u2014 Property name
227
+ type (BOOLEAN | TEXT | INSTANCE_SWAP, required) \u2014 Property type
228
+ defaultValue (string_or_boolean, required) \u2014 Default value
229
+ preferredValues (array, optional) \u2014 Preferred values for INSTANCE_SWAP
200
230
 
201
231
  ## from_node \u2014 Convert existing nodes to components. Text children auto-exposed as editable properties (exposeText: true).
202
- nodeId (string, required) \u2014 Node ID to convert
203
- name (string, optional) \u2014 Rename the component (default: keeps the node's current name)
204
- exposeText (boolean, optional) \u2014 Auto-expose text as editable properties (default: true)
232
+ Example: components(method:"create", type:"from_node", items:[{nodeId:"1:23", name:"Button", exposeText:true}])
233
+ Item fields for items[] when type:"from_node":
234
+ nodeId (string, required) \u2014 Node ID to convert
235
+ name (string, optional) \u2014 Rename the component (default: keeps the node's current name)
236
+ exposeText (boolean, optional) \u2014 Auto-expose text as editable properties (default: true)
205
237
 
206
238
  ## variant_set \u2014 Combine components into a variant set. The resulting set is a frame \u2014 accepts all frame properties for layout/styling.
207
- name (string, optional) \u2014 Node name
208
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
209
- x (number, optional) \u2014 X position (default: 0)
210
- y (number, optional) \u2014 Y position (default: 0)
211
- width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
212
- height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
213
- rotation (number, optional) \u2014 Rotation in degrees (0-360)
214
- visible (boolean, optional) \u2014 Show/hide (default true)
215
- locked (boolean, optional) \u2014 Lock/unlock (default false)
216
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
217
- blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
218
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
219
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
220
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
221
- fillStyleName (string, optional) \u2014 Paint style name for fill
222
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
223
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
224
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
225
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
226
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
227
- strokeStyleName (string, optional) \u2014 Paint style name for stroke
228
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
229
- strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
230
- strokeTopWeight (string, optional)
231
- strokeBottomWeight (string, optional)
232
- strokeLeftWeight (string, optional)
233
- strokeRightWeight (string, optional)
234
- strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
235
- cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
236
- topLeftRadius (string, optional)
237
- topRightRadius (string, optional)
238
- bottomRightRadius (string, optional)
239
- bottomLeftRadius (string, optional)
240
- layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
241
- layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
242
- padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
243
- paddingTop (string, optional)
244
- paddingRight (string, optional)
245
- paddingBottom (string, optional)
246
- paddingLeft (string, optional)
247
- primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
248
- counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
249
- itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
250
- counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
251
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
252
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
253
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
254
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
255
- layoutSizingVertical (FIXED | HUG | FILL, optional)
256
- minWidth (number, optional) \u2014 Min width for responsive auto-layout
257
- maxWidth (number, optional) \u2014 Max width for responsive auto-layout
258
- minHeight (number, optional) \u2014 Min height for responsive auto-layout
259
- maxHeight (number, optional) \u2014 Max height for responsive auto-layout
260
- annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
261
- componentIds (string[], optional) \u2014 Existing component IDs to combine (min 2). Alternative to children.
262
- variantPropertyName (string, optional) \u2014 Rename the auto-generated variant property (default: 'Property 1')
263
- children (array, optional) \u2014 Inline variant components. Each must be {type:"component", name, children?, ...frame_params}. All variants must share the same child structure. Alternative to componentIds \u2014 do not combine both.`,
264
- "commit": '# components.commit\nCommit a staged component \u2014 unwraps from [STAGED] container into the original target location.\n\nExample: components(method:"commit", id:"1:234")\n\nParams:\n id (string, required) \u2014 Staged node ID to commit',
265
- "update": '# components.update\nAdd, edit, or delete component properties\n\nExample: components(method:"update", items:[{id:"1:23", propertyName:"Label", action:"edit", defaultValue:"Click Me"}])\n\nParams:\n items (UpdatePropertyItem[], required) \u2014 Array of {id, propertyName, action?, type?, defaultValue?, name?, preferredValues?}\n id (string, required) \u2014 Component or component set ID\n propertyName (string, required) \u2014 Property name with #suffix for edit/delete (e.g. "Label#1:0"). Call components.get to find exact keys. For add, plain name works.\n action (add | edit | delete | rename_variant, optional) \u2014 "add" (default): requires type + defaultValue. "edit": pass defaultValue to change default, name to rename property. "delete": just propertyName. "rename_variant": pass defaultValue=current option name, name=new option name.\n type (BOOLEAN | TEXT | INSTANCE_SWAP | VARIANT, optional) \u2014 Property type (required for add)\n defaultValue (string_or_boolean, optional) \u2014 Default value (add/edit). For rename_variant: the CURRENT option name to rename\n name (string, optional) \u2014 New name \u2014 for edit: renames the property itself, for rename_variant: the new option value name\n preferredValues (array, optional) \u2014 Preferred values for INSTANCE_SWAP\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.',
266
- "delete": "# components.delete\nDelete components or component sets\n\nParams:\n id (string, required) \u2014 Component or component set ID"
239
+ Example: components(method:"create", type:"variant_set", items:[{name:"Button", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"HUG", layoutSizingVertical:"HUG", padding:"space/8", itemSpacing:"space/8", children:[{type:"component", name:"Style=Primary", minWidth:120, height:48, layoutMode:"HORIZONTAL", layoutSizingHorizontal:"HUG", layoutSizingVertical:"FIXED", padding:"space/12", cornerRadius:"radius/8", fillVariableName:"bg/accent", primaryAxisAlignItems:"CENTER", counterAxisAlignItems:"MIN", children:[{type:"text", name:"Button", text:"Button", width:72, componentPropertyName:"Button", textStyleName:"Body/Medium", fontColorVariableName:"text/inverse", textAlignHorizontal:"CENTER", textAlignVertical:"CENTER", layoutSizingHorizontal:"FIXED", layoutSizingVertical:"FILL"}]}, {type:"component", name:"Style=Secondary", minWidth:120, height:48, layoutMode:"HORIZONTAL", layoutSizingHorizontal:"HUG", layoutSizingVertical:"FIXED", padding:"space/12", cornerRadius:"radius/8", fillVariableName:"bg/surface", strokeVariableName:"border/subtle", strokeWeight:"stroke/1", primaryAxisAlignItems:"CENTER", counterAxisAlignItems:"MIN", children:[{type:"text", name:"Button", text:"Button", width:72, componentPropertyName:"Button", textStyleName:"Body/Medium", fontColorVariableName:"text/primary", textAlignHorizontal:"CENTER", textAlignVertical:"CENTER", layoutSizingHorizontal:"FIXED", layoutSizingVertical:"FILL"}]}]}])
240
+ Item fields for items[] when type:"variant_set":
241
+ name (string, optional) \u2014 Node name
242
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
243
+ x (number, optional) \u2014 X position (default: 0)
244
+ y (number, optional) \u2014 Y position (default: 0)
245
+ width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
246
+ height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
247
+ rotation (number, optional) \u2014 Rotation in degrees (0-360)
248
+ visible (boolean, optional) \u2014 Show/hide (default true)
249
+ locked (boolean, optional) \u2014 Lock/unlock (default false)
250
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
251
+ blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
252
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
253
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
254
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
255
+ fillStyleName (string, optional) \u2014 Paint style name for fill
256
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
257
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
258
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
259
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
260
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
261
+ strokeStyleName (string, optional) \u2014 Paint style name for stroke
262
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
263
+ strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
264
+ strokeTopWeight (string, optional)
265
+ strokeBottomWeight (string, optional)
266
+ strokeLeftWeight (string, optional)
267
+ strokeRightWeight (string, optional)
268
+ strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
269
+ cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
270
+ topLeftRadius (string, optional)
271
+ topRightRadius (string, optional)
272
+ bottomRightRadius (string, optional)
273
+ bottomLeftRadius (string, optional)
274
+ layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
275
+ layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
276
+ padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
277
+ paddingTop (string, optional)
278
+ paddingRight (string, optional)
279
+ paddingBottom (string, optional)
280
+ paddingLeft (string, optional)
281
+ primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
282
+ counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
283
+ itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
284
+ counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
285
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
286
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
287
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
288
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
289
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
290
+ minWidth (number, optional) \u2014 Min width for responsive auto-layout
291
+ maxWidth (number, optional) \u2014 Max width for responsive auto-layout
292
+ minHeight (number, optional) \u2014 Min height for responsive auto-layout
293
+ maxHeight (number, optional) \u2014 Max height for responsive auto-layout
294
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
295
+ componentIds (string[], optional) \u2014 Existing component IDs to combine (min 2). Alternative to children.
296
+ variantPropertyName (string, optional) \u2014 Rename the auto-generated variant property (default: 'Property 1')
297
+ children (array, optional) \u2014 Inline variant components. Each must be {type:"component", name, children?, ...frame_params}. Variant children use the same inline child types as components.create, including rectangle / ellipse / line. All variants must share the same child structure. Alternative to componentIds \u2014 do not combine both.
298
+
299
+ Response:
300
+ { results: ({id} | {error})[] }
301
+ // Shared types:
302
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
303
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
304
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
305
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
306
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
307
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
308
+ // Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}
309
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
310
+ "commit": '# components.commit\nCommit a staged component \u2014 unwraps from [STAGED] container into the original target location.\n\nExample: components(method:"commit", id:"1:234")\n\nParams:\n id (string, required) \u2014 Staged node ID to commit\n\nResponse:\n { results: ({id} | {error})[] }',
311
+ "update": '# components.update\nAdd, edit, or delete component properties\n\nExample: components(method:"update", items:[{id:"1:23", propertyName:"Show Icon", action:"add", type:"BOOLEAN", defaultValue:true}])\n\nParams:\n items (UpdatePropertyItem[], required) \u2014 Array of {id, propertyName, action?, type?, defaultValue?, name?, preferredValues?}\n id (string, required) \u2014 Component or component set ID\n propertyName (string, required) \u2014 Property name with #suffix for edit/delete (e.g. "Label#1:0"). Call components.get to find exact keys. For add, plain name works.\n action (add | edit | delete | rename_variant, optional) \u2014 "add" (default): requires type + defaultValue. "edit": pass defaultValue to change default, name to rename property. "delete": just propertyName. "rename_variant": pass defaultValue=current option name, name=new option name.\n type (BOOLEAN | TEXT | INSTANCE_SWAP | VARIANT, optional) \u2014 Property type (required for add)\n defaultValue (string_or_boolean, optional) \u2014 Default value (add/edit). For rename_variant: the CURRENT option name to rename\n name (string, optional) \u2014 New name \u2014 for edit: renames the property itself, for rename_variant: the new option value name\n preferredValues (array, optional) \u2014 Preferred values for INSTANCE_SWAP\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n\nResponse:\n { results: ("ok" | {error} | object)[] }',
312
+ "delete": '# components.delete\nDelete components or component sets\n\nParams:\n id (string, required) \u2014 Component or component set ID\n\nResponse:\n { results: ("ok" | {error})[] }'
267
313
  }
268
314
  },
269
315
  "connection": {
270
316
  "summary": '# connection\nManage the Figma plugin connection.\n\nMethods:\n create Join a relay channel (required first step before any other tool) [read]\n get Verify end-to-end connection to Figma [read]\n list Inspect which clients (MCP, plugin) are connected to each channel [read]\n delete Disconnect all clients (MCP server and Figma plugin) from a channel and reset its state [edit]\n\n// Connection manages the WebSocket link between the MCP server and the Figma plugin.\n// Channels are named rooms \u2014 both the MCP server and Figma plugin must join the same channel to communicate.\n// Workflow: connection(method:"create") to join a channel \u2192 connection(method:"get") to verify Figma plugin is connected.\n// If get times out (5s), the Figma plugin is not running or not on the same channel.\n// list shows all active channels and their connected clients. delete factory-resets a channel.\n\nUse connection(method: "help", topic: "<method>") for method details.',
271
317
  "methods": {
272
- "create": "# connection.create\nJoin a relay channel (required first step before any other tool)\n\nParams:\n channel (string, optional) \u2014 The channel name displayed in the Figma plugin panel. Defaults to 'vibma' if omitted.",
273
- "get": "# connection.get\nVerify end-to-end connection to Figma\n\nNo params.",
274
- "list": "# connection.list\nInspect which clients (MCP, plugin) are connected to each channel\n\nNo params.",
275
- "delete": "# connection.delete\nDisconnect all clients (MCP server and Figma plugin) from a channel and reset its state\n\nParams:\n channel (string, optional) \u2014 Channel to reset. Defaults to 'vibma'."
318
+ "create": "# connection.create\nJoin a relay channel (required first step before any other tool)\n\nParams:\n channel (string, optional) \u2014 The channel name displayed in the Figma plugin panel. Defaults to 'vibma' if omitted.\n\nResponse:\n Confirmation message with channel and port\n string",
319
+ "get": "# connection.get\nVerify end-to-end connection to Figma\n\nNo params.\n\nResponse:\n status (string, required)\n documentName (string, required) \u2014 Active Figma document name\n currentPage (string, required) \u2014 Current page name\n timestamp (number, required) \u2014 Unix timestamp",
320
+ "list": "# connection.list\nInspect which clients (MCP, plugin) are connected to each channel\n\nNo params.\n\nResponse:\n Map of channel names to their connected clients\n object",
321
+ "delete": "# connection.delete\nDisconnect all clients (MCP server and Figma plugin) from a channel and reset its state\n\nParams:\n channel (string, optional) \u2014 Channel to reset. Defaults to 'vibma'.\n\nResponse:\n Confirmation of tunnel reset\n string"
276
322
  }
277
323
  },
278
324
  "document": {
279
325
  "summary": '# document\nNavigate and manage Figma pages (canvases) in the document.\n\nMethods:\n get Get current page with top-level children [read]\n list Get document name and list all pages [read]\n set Switch to a page by ID or name. At least one of pageId or pageName must be provided. [read]\n create Create a new page [create]\n update Rename a page [edit]\n\n// A Figma document contains pages \u2014 each page is an independent canvas with its own node tree.\n// The "current page" is where all node operations happen. Use document.set to switch pages before working with nodes.\n// Page IDs look like "0:1", "1:1", etc. The first page is always "0:1".\n// get returns the current page with its top-level children as stubs. list returns all pages in the document.\n\nUse document(method: "help", topic: "<method>") for method details.',
280
326
  "methods": {
281
- "get": "# document.get\nGet current page with top-level children\n\nNo params.",
282
- "list": "# document.list\nGet document name and list all pages\n\nNo params.",
283
- "set": "# document.set\nSwitch to a page by ID or name. At least one of pageId or pageName must be provided.\n\nParams:\n pageId (string, optional) \u2014 Page ID\n pageName (string, optional) \u2014 Page name (case-insensitive, substring match)",
284
- "create": "# document.create\nCreate a new page\n\nParams:\n name (string, optional) \u2014 Page name (default: 'New Page')",
285
- "update": "# document.update\nRename a page\n\nParams:\n newName (string, required) \u2014 New page name\n pageId (string, optional) \u2014 Page ID (default: current page)"
327
+ "get": '# document.get\nGet current page with top-level children\n\nNo params.\n\nResponse:\n id (string, required)\n name (string, required)\n backgroundColor (string, optional) \u2014 Canvas background hex color (e.g. "#F5F5F5")\n children (NodeStub[], required)\n// Shared types:\n// NodeStub: {id: string, name: string, type: string}',
328
+ "list": "# document.list\nGet document name and list all pages\n\nNo params.\n\nResponse:\n name (string, required) \u2014 Document name\n currentPageId (string, required)\n pages (array, required)\n id (string, required)\n name (string, required)",
329
+ "set": "# document.set\nSwitch to a page by ID or name. At least one of pageId or pageName must be provided.\n\nParams:\n pageId (string, optional) \u2014 Page ID\n pageName (string, optional) \u2014 Page name (case-insensitive, substring match)\n\nResponse:\n id (string, required)\n name (string, required)",
330
+ "create": "# document.create\nCreate a new page\n\nParams:\n name (string, optional) \u2014 Page name (default: 'New Page')\n\nResponse:\n id (string, required) \u2014 New page ID",
331
+ "update": "# document.update\nRename a page\n\nParams:\n newName (string, required) \u2014 New page name\n pageId (string, optional) \u2014 Page ID (default: current page)\n\nResponse:\n string"
286
332
  }
287
333
  },
288
334
  "fonts": {
289
335
  "summary": '# fonts\nSearch available fonts in Figma.\n\nMethods:\n list List available font families, optionally filtered by name [read]\n\n// Returns font family names installed in the Figma environment. Use to verify a fontFamily before text.create or styles.create.\n// query filters by family name substring (case-insensitive), e.g. query:"inter" matches "Inter", "Inter Tight".\n// ---\n// Default response: just family names. Set includeStyles:true to also get available styles per family (e.g. "Regular", "Bold", "Italic").\n// Use fonts.list with query to narrow results before creating text with specific fontFamily + fontStyle.\n\nUse fonts(method: "help", topic: "<method>") for method details.',
290
336
  "methods": {
291
- "list": '# fonts.list\nList available font families, optionally filtered by name\n\nExample: fonts(method:"list", query:"inter")\n\nParams:\n query (string, optional) \u2014 Filter by family name (case-insensitive substring)\n includeStyles (boolean, optional) \u2014 Include available styles per family (default: false)\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)'
337
+ "list": '# fonts.list\nList available font families, optionally filtered by name\n\nExample: fonts(method:"list", query:"inter")\n\nParams:\n query (string, optional) \u2014 Filter by family name (case-insensitive substring)\n includeStyles (boolean, optional) \u2014 Include available styles per family (default: false)\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n count (number, required) \u2014 Number of matching families\n fonts (array, required) \u2014 Array of {family} stubs, or {family, styles[]} when includeStyles:true\n family (string, required)\n styles (array, optional)'
292
338
  }
293
339
  },
294
340
  "frames": {
295
- "summary": '# frames\nCreate and manage frames, shapes, auto-layout containers, sections, and SVG nodes.\n\nMethods:\n get Get serialized node data [read]\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n update Patch node properties [edit]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n create Create frame-like containers [create]\n commit Commit a staged node \u2014 unwraps from [STAGED] container into the original target location. [edit]\n export Export a node as PNG, JPG, SVG, SVG_STRING, or PDF [read]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// properties: escape hatch \u2014 set any Figma node property directly. Use only when no dedicated field exists.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}}\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.\n// Unknown keys produce a warning, preventing silent failures.\n// Frames are the primary container in Figma. Use auto_layout for responsive containers.\n// Sizing: FIXED = explicit size, HUG = shrink to children, FILL = expand to fill parent.\n// Fill: pass fills:[{type:"SOLID", color:"#hex"}] or [] for transparent. Shorthand: fillColor:"#3B82F6" (auto-binds to matching variable/style).\n// Also: fillVariableName:"bg/primary", fillStyleName:"Surface/Primary".\n// Image fill: imageUrl accepts "pexel:<id>", a public URL, or a local file path. SVGs become vector nodes; raster images become IMAGE fills. imageScaleMode: FILL (default), FIT, CROP, TILE.\n// Stroke: pass strokes:[{type:"SOLID", color:"#hex"}] or [] to clear. Shorthand: strokeColor:"#000", strokeVariableName:"border/default".\n// Token fields (cornerRadius, opacity, itemSpacing, padding, strokeWeight): pass number for value, string for variable name/ID.\n// ---\n// SIZING: Always think about both axes. Containers with text need a width constraint \u2014 set width + layoutSizingHorizontal:"FIXED".\n// HUG/HUG is only correct for intrinsically-sized elements (buttons, badges, icons).\n// Smart defaults inside auto-layout parent: cross-axis defaults to FILL, primary axis stays HUG.\n// FILL only works inside an auto-layout parent. Use FIXED for top-level frames.\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// clipsContent: true (default) clips children to the frame bounds. Set false for overflow-visible.\n// Sections are top-level organizers (like artboards) \u2014 they cannot be nested inside frames.\n// Shape primitives: rectangle, ellipse, line \u2014 for decorative/visual elements (not containers).\n// group: wraps existing nodes into a Group. boolean_operation: UNION/SUBTRACT/INTERSECT/EXCLUDE combines shapes.\n// SVG create: pass raw SVG markup string (e.g. "<svg>...</svg>") \u2014 Figma converts it to vector nodes.\n\nUse frames(method: "help", topic: "<method>") for method details.',
341
+ "summary": '# frames\nCreate and manage frames, shapes, auto-layout containers, sections, and SVG nodes.\n\nMethods:\n get Get serialized node data [read]\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n update Patch node properties [edit]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n scale Proportionally rescale a node subtree using Figma\'s visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing. [edit]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n create Create frame-like containers [create]\n commit Commit a staged node \u2014 unwraps from [STAGED] container into the original target location. [edit]\n export Export a node as PNG, JPG, SVG, SVG_STRING, or PDF [read]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// clipsContent: clip children to the node bounds where supported (frames/components/instances). Set false for overflow-visible layouts.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // readback Paint[]; authoring supports SOLID + gradients via gradientTransform + gradientStops\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create. Paint[] authoring supports SOLID + gradients only; IMAGE/VIDEO/PATTERN are readback-only metadata.\n// Unknown keys produce a warning, preventing silent failures.\n// Frames are the primary container in Figma. Use auto_layout for responsive containers.\n// Sizing: FIXED = explicit size, HUG = shrink to children, FILL = expand to fill parent.\n// Fill: prefer fillVariableName/fillStyleName. Use fills:[{type:"SOLID", color:"#hex"}] or gradient Paint[] (GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND) with gradientTransform + gradientStops only for one-off values; [] for transparent. Shorthand: fillColor:"#3B82F6" (auto-binds single solids).\n// Also: fillVariableName:"bg/surface", fillStyleName:"Surface/Primary". Do not use CSS gradients, REST gradientHandlePositions, or top-level gradient boundVariables.\n// Image fill: use imageUrl/images for image authoring. imageUrl accepts "pexel:<id>", a public URL, or a local file path. SVGs become vector nodes; raster images become IMAGE fills. IMAGE/VIDEO/PATTERN may appear in readback metadata only; do not pass those objects in Paint[]. imageScaleMode: FILL (default), FIT, CROP, TILE.\n// Stroke: prefer strokeVariableName/strokeStyleName. Use strokes:[{type:"SOLID", color:"#hex"}] or gradient Paint[] (GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND) with gradientTransform + gradientStops only for one-off values; [] to clear. Shorthand: strokeColor:"#000", strokeVariableName:"border/default".\n// Token fields (cornerRadius, opacity, itemSpacing, padding, strokeWeight): pass number for value, string for variable name/ID.\n// Examples assume design tokens/styles already exist. Prefer token names (fillVariableName, strokeVariableName, padding:"space/16", cornerRadius:"radius/8") over raw values in production designs.\n// ---\n// SIZING: Always think about both axes. Containers with text need a width constraint \u2014 set width + layoutSizingHorizontal:"FIXED".\n// HUG/HUG is only correct for intrinsically-sized elements (buttons, badges, icons).\n// Smart defaults inside auto-layout parent: cross-axis defaults to FILL, primary axis stays HUG.\n// FILL only works inside an auto-layout parent. Use FIXED for top-level frames.\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// clipsContent: true (default) clips children to the frame bounds. Set false for overflow-visible.\n// Sections are top-level organizers (like artboards) \u2014 they cannot be nested inside frames.\n// Shape primitives: rectangle, ellipse, line \u2014 for decorative/visual elements (not containers).\n// group: wraps existing nodes into a Group. boolean_operation: UNION/SUBTRACT/INTERSECT/EXCLUDE combines shapes.\n// SVG create: pass raw SVG markup string (e.g. "<svg>...</svg>") \u2014 Figma converts it to vector nodes.\n\nUse frames(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// NodeStub: {id: string, name: string, type: string}',
296
342
  "methods": {
297
- "get": '# frames.get\nGet serialized node data\n\nParams:\n id (string, required) \u2014 Node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.',
298
- "list": '# frames.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
343
+ "get": '# frames.get\nGet serialized node data\n\nParams:\n id (string, required) \u2014 Node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.\n\nResponse:\n Serialized node tree. Shape depends on depth parameter.\n results (Node[], required) \u2014 Serialized node trees\n _truncated (boolean, optional) \u2014 True when node budget exceeded\n _notice (string, optional) \u2014 Human-readable truncation notice',
344
+ "list": '# frames.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n Paginated node search results (uses `results` not `items`)\n totalCount (number, required) \u2014 Total matching nodes\n returned (number, required) \u2014 Nodes in this page\n offset (number, optional)\n limit (number, optional)\n results (array, required) \u2014 Matching node stubs\n id (string, required)\n name (string, required)\n type (string, required)\n parentId (string, required)\n parentName (string, optional)\n bounds (object, optional)',
299
345
  "update": `# frames.update
300
346
  Patch node properties
301
347
 
302
348
  Params:
303
- items (PatchItem[], required) \u2014 Array of {id, ...properties} to patch
304
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
349
+ items (PatchItem[], required) \u2014 Array of {id, ...fields} to patch
350
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
305
351
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
306
352
  fillStyleName (string, optional) \u2014 Paint style name for fill
307
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
308
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
353
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
354
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
309
355
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
310
356
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
311
357
  strokeVariableName (string, optional) \u2014 Color variable by name for stroke
@@ -380,9 +426,35 @@ Params:
380
426
  explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
381
427
  exportSettings (array, optional) \u2014 Export settings
382
428
  annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
383
- properties (object, optional) \u2014 Direct Figma API props (escape hatch)`,
384
- "delete": "# frames.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)",
385
- "clone": "# frames.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
429
+ clipsContent (boolean, optional) \u2014 Clip children to bounds where supported (frames/components/instances).
430
+
431
+ Response:
432
+ { results: ("ok" | {error} | object)[] }
433
+ // Shared types:
434
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
435
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
436
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
437
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
438
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
439
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
440
+ // Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}
441
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
442
+ "delete": '# frames.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
443
+ "clone": "# frames.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n\nResponse:\n { results: ({id} | {error})[] }",
444
+ "scale": `# frames.scale
445
+ Proportionally rescale a node subtree using Figma's visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing.
446
+
447
+ Example: frames(method:"scale", id:"1:23", factor:0.5)
448
+
449
+ Params:
450
+ id (string, optional) \u2014 Node ID to scale
451
+ factor (number, optional) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%. Scales children, text, strokes, effects, and layout geometry from the node's top-left. On auto-layout or HUG/FILL nodes, Figma may resolve responsive sizing to fixed width/height.
452
+ items (array, optional) \u2014 Batch: [{id, factor}, ...]. Alternative to single-item params.
453
+ id (string, required) \u2014 Node ID to scale
454
+ factor (number, required) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%.
455
+
456
+ Response:
457
+ { results: ("ok" | {error})[] }`,
386
458
  "audit": `# frames.audit
387
459
  Run lint on a node \u2014 returns severity-ranked findings
388
460
 
@@ -392,299 +464,346 @@ Params:
392
464
  maxDepth (number, optional) \u2014 Max tree depth (default: 10)
393
465
  maxFindings (number, optional) \u2014 Max findings (default: 50)
394
466
  minSeverity (error | unsafe | heuristic | style | verbose, optional) \u2014 Minimum severity to report (default: style). Set to 'verbose' to include AAA contrast and line-height checks.
395
- skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
396
- "reparent": "# frames.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)",
467
+ skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)
468
+
469
+ Response:
470
+ nodeId (string, optional)
471
+ nodeName (string, optional)
472
+ categories (array, optional) \u2014 Sorted by severity (error > unsafe > heuristic > style)`,
473
+ "reparent": '# frames.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
397
474
  "create": `# frames.create
398
475
  Create frame-like containers
399
476
 
400
- Example: frames(method:"create", type:"auto_layout", layoutMode:"VERTICAL", itemSpacing:16, padding:24)
477
+ Example: frames(method:"create", type:"rectangle", items:[{name:"Gradient Box", fills:[{type:"GRADIENT_LINEAR", gradientTransform:[[1,0,0],[0,1,0]], gradientStops:[{position:0,color:"#FF6B6B"},{position:1,color:"#FFD93D"}]}]}])
478
+
479
+ Call shape: frames(method:"create", type:"<type>", items:[{...type-specific fields...}])
480
+ Do not pass type-specific item fields at the top level; put them inside items[].
401
481
 
402
482
  Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line | group | boolean_operation | svg | slot)
483
+ Top-level params:
484
+ type (frame | auto_layout | section | rectangle | ellipse | line | group | boolean_operation | svg | slot, required) \u2014 Selects which item shape to use
485
+ items (array, required) \u2014 One or more type-specific item objects
403
486
 
404
487
  ## frame \u2014 General-purpose frame \u2014 shrinks to content by default, static when width+height given
405
- name (string, optional) \u2014 Node name
406
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
407
- x (number, optional) \u2014 X position (default: 0)
408
- y (number, optional) \u2014 Y position (default: 0)
409
- width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
410
- height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
411
- rotation (number, optional) \u2014 Rotation in degrees (0-360)
412
- visible (boolean, optional) \u2014 Show/hide (default true)
413
- locked (boolean, optional) \u2014 Lock/unlock (default false)
414
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
415
- blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
416
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
417
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
418
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
419
- fillStyleName (string, optional) \u2014 Paint style name for fill
420
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
421
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
422
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
423
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
424
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
425
- strokeStyleName (string, optional) \u2014 Paint style name for stroke
426
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
427
- strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
428
- strokeTopWeight (string, optional)
429
- strokeBottomWeight (string, optional)
430
- strokeLeftWeight (string, optional)
431
- strokeRightWeight (string, optional)
432
- strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
433
- cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
434
- topLeftRadius (string, optional)
435
- topRightRadius (string, optional)
436
- bottomRightRadius (string, optional)
437
- bottomLeftRadius (string, optional)
438
- layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
439
- layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
440
- padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
441
- paddingTop (string, optional)
442
- paddingRight (string, optional)
443
- paddingBottom (string, optional)
444
- paddingLeft (string, optional)
445
- primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
446
- counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
447
- itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
448
- counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
449
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
450
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
451
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
452
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
453
- layoutSizingVertical (FIXED | HUG | FILL, optional)
454
- minWidth (number, optional) \u2014 Min width for responsive auto-layout
455
- maxWidth (number, optional) \u2014 Max width for responsive auto-layout
456
- minHeight (number, optional) \u2014 Min height for responsive auto-layout
457
- maxHeight (number, optional) \u2014 Max height for responsive auto-layout
458
- annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
459
- clipsContent (boolean, optional)
460
- children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Title", fontSize:20, layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.
488
+ Example: frames(method:"create", type:"frame", items:[{name:"Dashboard Shell", x:0, y:0, width:1440, height:900, fillVariableName:"bg/canvas", children:[{type:"frame", name:"Content Area", x:80, y:80, width:640, height:360, layoutMode:"VERTICAL", padding:"space/24", itemSpacing:"space/12", fillVariableName:"bg/surface", cornerRadius:"radius/12", children:[{type:"text", name:"Dashboard overview", text:"Dashboard overview", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}]}])
489
+ Item fields for items[] when type:"frame":
490
+ name (string, optional) \u2014 Node name
491
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
492
+ x (number, optional) \u2014 X position (default: 0)
493
+ y (number, optional) \u2014 Y position (default: 0)
494
+ width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
495
+ height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
496
+ rotation (number, optional) \u2014 Rotation in degrees (0-360)
497
+ visible (boolean, optional) \u2014 Show/hide (default true)
498
+ locked (boolean, optional) \u2014 Lock/unlock (default false)
499
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
500
+ blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
501
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
502
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
503
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
504
+ fillStyleName (string, optional) \u2014 Paint style name for fill
505
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
506
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
507
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
508
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
509
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
510
+ strokeStyleName (string, optional) \u2014 Paint style name for stroke
511
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
512
+ strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
513
+ strokeTopWeight (string, optional)
514
+ strokeBottomWeight (string, optional)
515
+ strokeLeftWeight (string, optional)
516
+ strokeRightWeight (string, optional)
517
+ strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
518
+ cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
519
+ topLeftRadius (string, optional)
520
+ topRightRadius (string, optional)
521
+ bottomRightRadius (string, optional)
522
+ bottomLeftRadius (string, optional)
523
+ layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
524
+ layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
525
+ padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
526
+ paddingTop (string, optional)
527
+ paddingRight (string, optional)
528
+ paddingBottom (string, optional)
529
+ paddingLeft (string, optional)
530
+ primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
531
+ counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
532
+ itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
533
+ counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
534
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
535
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
536
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
537
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
538
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
539
+ minWidth (number, optional) \u2014 Min width for responsive auto-layout
540
+ maxWidth (number, optional) \u2014 Max width for responsive auto-layout
541
+ minHeight (number, optional) \u2014 Min height for responsive auto-layout
542
+ maxHeight (number, optional) \u2014 Max height for responsive auto-layout
543
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
544
+ clipsContent (boolean, optional)
545
+ children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, textStyleName?, fontColorVariableName?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillVariableName?, itemSpacing?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. rectangle / ellipse / line: same params as the corresponding frames(method:"create", type:"rectangle"|"ellipse"|"line") branch. All params from text/frame endpoints are supported on their respective types. Inline fills/strokes accept Paint[] authoring input: SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. Do not use CSS gradients, REST gradientHandlePositions, or IMAGE/VIDEO/PATTERN in Paint[] authoring. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"ellipse", name:"Dot", width:6, height:6, fillVariableName:"status/active"}, {type:"text", name:"Title", text:"Title", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:"space/8", children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.
461
546
 
462
547
 
463
548
  ## auto_layout \u2014 Auto-layout frame that arranges children automatically
464
- name (string, optional) \u2014 Node name
465
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
466
- x (number, optional) \u2014 X position (default: 0)
467
- y (number, optional) \u2014 Y position (default: 0)
468
- width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
469
- height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
470
- rotation (number, optional) \u2014 Rotation in degrees (0-360)
471
- visible (boolean, optional) \u2014 Show/hide (default true)
472
- locked (boolean, optional) \u2014 Lock/unlock (default false)
473
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
474
- blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
475
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
476
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
477
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
478
- fillStyleName (string, optional) \u2014 Paint style name for fill
479
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
480
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
481
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
482
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
483
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
484
- strokeStyleName (string, optional) \u2014 Paint style name for stroke
485
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
486
- strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
487
- strokeTopWeight (string, optional)
488
- strokeBottomWeight (string, optional)
489
- strokeLeftWeight (string, optional)
490
- strokeRightWeight (string, optional)
491
- strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
492
- cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
493
- topLeftRadius (string, optional)
494
- topRightRadius (string, optional)
495
- bottomRightRadius (string, optional)
496
- bottomLeftRadius (string, optional)
497
- layoutMode (HORIZONTAL | VERTICAL, required) \u2014 Primary axis direction
498
- layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
499
- padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
500
- paddingTop (string, optional)
501
- paddingRight (string, optional)
502
- paddingBottom (string, optional)
503
- paddingLeft (string, optional)
504
- primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
505
- counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
506
- itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
507
- counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
508
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
509
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
510
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
511
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
512
- layoutSizingVertical (FIXED | HUG | FILL, optional)
513
- minWidth (number, optional) \u2014 Min width for responsive auto-layout
514
- maxWidth (number, optional) \u2014 Max width for responsive auto-layout
515
- minHeight (number, optional) \u2014 Min height for responsive auto-layout
516
- maxHeight (number, optional) \u2014 Max height for responsive auto-layout
517
- annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
518
- clipsContent (boolean, optional)
519
- nodeIds (string[], optional) \u2014 Existing node IDs to wrap into auto-layout
520
- children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Title", fontSize:20, layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.
549
+ Example: frames(method:"create", type:"auto_layout", items:[{name:"Settings Card", width:360, height:180, layoutMode:"VERTICAL", padding:"space/24", itemSpacing:"space/12", fillVariableName:"bg/surface", strokeVariableName:"border/subtle", strokeWeight:"stroke/1", cornerRadius:"radius/12", children:[{type:"text", name:"Team settings", text:"Team settings", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"text", name:"Manage workspace preferences.", text:"Manage workspace preferences.", textStyleName:"Body/Regular", fontColorVariableName:"text/secondary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}])
550
+ Item fields for items[] when type:"auto_layout":
551
+ name (string, optional) \u2014 Node name
552
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
553
+ x (number, optional) \u2014 X position (default: 0)
554
+ y (number, optional) \u2014 Y position (default: 0)
555
+ width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
556
+ height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
557
+ rotation (number, optional) \u2014 Rotation in degrees (0-360)
558
+ visible (boolean, optional) \u2014 Show/hide (default true)
559
+ locked (boolean, optional) \u2014 Lock/unlock (default false)
560
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
561
+ blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
562
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
563
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
564
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
565
+ fillStyleName (string, optional) \u2014 Paint style name for fill
566
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
567
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
568
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
569
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
570
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
571
+ strokeStyleName (string, optional) \u2014 Paint style name for stroke
572
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
573
+ strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
574
+ strokeTopWeight (string, optional)
575
+ strokeBottomWeight (string, optional)
576
+ strokeLeftWeight (string, optional)
577
+ strokeRightWeight (string, optional)
578
+ strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
579
+ cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
580
+ topLeftRadius (string, optional)
581
+ topRightRadius (string, optional)
582
+ bottomRightRadius (string, optional)
583
+ bottomLeftRadius (string, optional)
584
+ layoutMode (HORIZONTAL | VERTICAL, required) \u2014 Primary axis direction
585
+ layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
586
+ padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
587
+ paddingTop (string, optional)
588
+ paddingRight (string, optional)
589
+ paddingBottom (string, optional)
590
+ paddingLeft (string, optional)
591
+ primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
592
+ counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
593
+ itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
594
+ counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
595
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
596
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
597
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
598
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
599
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
600
+ minWidth (number, optional) \u2014 Min width for responsive auto-layout
601
+ maxWidth (number, optional) \u2014 Max width for responsive auto-layout
602
+ minHeight (number, optional) \u2014 Min height for responsive auto-layout
603
+ maxHeight (number, optional) \u2014 Max height for responsive auto-layout
604
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
605
+ clipsContent (boolean, optional)
606
+ nodeIds (string[], optional) \u2014 Existing node IDs to wrap into auto-layout
607
+ children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, textStyleName?, fontColorVariableName?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillVariableName?, itemSpacing?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. rectangle / ellipse / line: same params as the corresponding frames(method:"create", type:"rectangle"|"ellipse"|"line") branch. All params from text/frame endpoints are supported on their respective types. Inline fills/strokes accept Paint[] authoring input: SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. Do not use CSS gradients, REST gradientHandlePositions, or IMAGE/VIDEO/PATTERN in Paint[] authoring. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"ellipse", name:"Dot", width:6, height:6, fillVariableName:"status/active"}, {type:"text", name:"Title", text:"Title", textStyleName:"Heading/Medium", fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:"space/8", children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.
521
608
 
522
609
 
523
610
  ## section \u2014 Figma section (top-level organizer)
524
- name (string, required) \u2014 Section name
525
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
526
- x (number, optional) \u2014 X position (default: 0)
527
- y (number, optional) \u2014 Y position (default: 0)
528
- width (number, optional) \u2014 Width (default: 500)
529
- height (number, optional) \u2014 Height (default: 500)
530
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent
531
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
532
- fillStyleName (string, optional) \u2014 Paint style name for fill
533
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
534
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
535
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
611
+ Example: frames(method:"create", type:"section", items:[{name:"Components", x:0, y:0, width:1200, height:800, fillVariableName:"bg/canvas"}])
612
+ Item fields for items[] when type:"section":
613
+ name (string, required) \u2014 Section name
614
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
615
+ x (number, optional) \u2014 X position (default: 0)
616
+ y (number, optional) \u2014 Y position (default: 0)
617
+ width (number, optional) \u2014 Width (default: 500)
618
+ height (number, optional) \u2014 Height (default: 500)
619
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only
620
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
621
+ fillStyleName (string, optional) \u2014 Paint style name for fill
622
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
623
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
624
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
536
625
 
537
626
  ## rectangle \u2014 Rectangle shape node
538
- name (string, optional) \u2014 Layer name (default: 'Rectangle')
539
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
540
- x (number, optional) \u2014 X position (default: 0)
541
- y (number, optional) \u2014 Y position (default: 0)
542
- width (number, optional) \u2014 Width in px (default: 100)
543
- height (number, optional) \u2014 Height in px (default: 100)
544
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent
545
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
546
- fillStyleName (string, optional) \u2014 Paint style name for fill
547
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
548
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
549
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
550
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
551
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
552
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
553
- strokeWeight (string, optional)
554
- cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
555
- topLeftRadius (string, optional)
556
- topRightRadius (string, optional)
557
- bottomRightRadius (string, optional)
558
- bottomLeftRadius (string, optional)
559
- opacity (string, optional)
560
- layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
561
- layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
562
- annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
627
+ Example: frames(method:"create", type:"rectangle", items:[{name:"Avatar Placeholder", width:64, height:64, cornerRadius:"radius/16", fillVariableName:"bg/muted"}])
628
+ Item fields for items[] when type:"rectangle":
629
+ name (string, optional) \u2014 Layer name (default: 'Rectangle')
630
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
631
+ x (number, optional) \u2014 X position (default: 0)
632
+ y (number, optional) \u2014 Y position (default: 0)
633
+ width (number, optional) \u2014 Width in px (default: 100)
634
+ height (number, optional) \u2014 Height in px (default: 100)
635
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only
636
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
637
+ fillStyleName (string, optional) \u2014 Paint style name for fill
638
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
639
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
640
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
641
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only
642
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
643
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
644
+ strokeWeight (string, optional)
645
+ cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
646
+ topLeftRadius (string, optional)
647
+ topRightRadius (string, optional)
648
+ bottomRightRadius (string, optional)
649
+ bottomLeftRadius (string, optional)
650
+ opacity (string, optional)
651
+ layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
652
+ layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
653
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
563
654
 
564
655
  ## ellipse \u2014 Ellipse/circle shape node
565
- name (string, optional) \u2014 Layer name (default: 'Ellipse')
566
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
567
- x (number, optional) \u2014 X position (default: 0)
568
- y (number, optional) \u2014 Y position (default: 0)
569
- width (number, optional) \u2014 Width in px (default: 100)
570
- height (number, optional) \u2014 Height in px (default: 100, same as width for circle)
571
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent
572
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
573
- fillStyleName (string, optional) \u2014 Paint style name for fill
574
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
575
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
576
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
577
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
578
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
579
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
580
- strokeWeight (string, optional)
581
- opacity (string, optional)
582
- layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
583
- layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
584
- annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
656
+ Example: frames(method:"create", type:"ellipse", items:[{name:"Status Dot", width:12, height:12, fillVariableName:"status/success"}])
657
+ Item fields for items[] when type:"ellipse":
658
+ name (string, optional) \u2014 Layer name (default: 'Ellipse')
659
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
660
+ x (number, optional) \u2014 X position (default: 0)
661
+ y (number, optional) \u2014 Y position (default: 0)
662
+ width (number, optional) \u2014 Width in px (default: 100)
663
+ height (number, optional) \u2014 Height in px (default: 100, same as width for circle)
664
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only
665
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
666
+ fillStyleName (string, optional) \u2014 Paint style name for fill
667
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
668
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
669
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
670
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only
671
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
672
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
673
+ strokeWeight (string, optional)
674
+ opacity (string, optional)
675
+ layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
676
+ layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
677
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
585
678
 
586
679
  ## line \u2014 Line shape node
587
- name (string, optional) \u2014 Layer name (default: 'Line')
588
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
589
- x (number, optional) \u2014 X position (default: 0)
590
- y (number, optional) \u2014 Y position (default: 0)
591
- length (number, optional) \u2014 Line length in px (default: 100)
592
- rotation (number, optional) \u2014 Rotation in degrees (default: 0 = horizontal)
593
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
594
- strokeColor (Color, optional) \u2014 Line color (default: black, auto-binds to matching variable/style)
595
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
596
- strokeWeight (string, optional) \u2014 Line thickness (default: 1)
597
- opacity (string, optional)
598
- layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent (defaults to FILL in vertical auto-layout)
599
- annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
680
+ Example: frames(method:"create", type:"line", items:[{name:"Divider", length:320, strokeVariableName:"border/subtle", strokeWeight:"stroke/1"}])
681
+ Item fields for items[] when type:"line":
682
+ name (string, optional) \u2014 Layer name (default: 'Line')
683
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
684
+ x (number, optional) \u2014 X position (default: 0)
685
+ y (number, optional) \u2014 Y position (default: 0)
686
+ length (number, optional) \u2014 Line length in px (default: 100)
687
+ rotation (number, optional) \u2014 Rotation in degrees (default: 0 = horizontal)
688
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only
689
+ strokeColor (Color, optional) \u2014 Line color (default: black, auto-binds to matching variable/style)
690
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
691
+ strokeWeight (string, optional) \u2014 Line thickness (default: 1)
692
+ opacity (string, optional)
693
+ layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent (defaults to FILL in vertical auto-layout)
694
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
600
695
 
601
696
  ## group \u2014 Group existing nodes together
602
- nodeIds (string[], required) \u2014 Node IDs to group (min 1)
603
- name (string, optional) \u2014 Group name
604
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
697
+ Example: frames(method:"create", type:"group", items:[{nodeIds:["1:2","1:3"], name:"Icon Group"}])
698
+ Item fields for items[] when type:"group":
699
+ nodeIds (string[], required) \u2014 Node IDs to group (min 1)
700
+ name (string, optional) \u2014 Group name
701
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
605
702
 
606
703
  ## boolean_operation \u2014 Combine shapes with boolean operations (union, subtract, intersect, exclude)
607
- operation (UNION | SUBTRACT | INTERSECT | EXCLUDE, required) \u2014 Boolean operation type
608
- nodeIds (string[], required) \u2014 Node IDs to combine (min 2, first node is the base for SUBTRACT)
609
- name (string, optional) \u2014 Result node name
610
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
704
+ Example: frames(method:"create", type:"boolean_operation", items:[{operation:"UNION", nodeIds:["1:2","1:3"], name:"Combined Shape", fillVariableName:"bg/accent"}])
705
+ Item fields for items[] when type:"boolean_operation":
706
+ fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
707
+ fillVariableName (string, optional) \u2014 Color variable by name for vector fills
708
+ strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
709
+ strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes
710
+ operation (UNION | SUBTRACT | INTERSECT | EXCLUDE, required) \u2014 Boolean operation type
711
+ nodeIds (string[], required) \u2014 Node IDs to combine (min 2, first node is the base for SUBTRACT)
712
+ name (string, optional) \u2014 Result node name
713
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
611
714
 
612
715
  ## svg \u2014 Create node from SVG markup
613
- fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
614
- fillVariableName (string, optional) \u2014 Color variable by name for vector fills
615
- strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
616
- strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes
617
- svg (string, required) \u2014 SVG markup string
618
- name (string, optional) \u2014 Layer name (default: 'SVG')
619
- parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
620
- x (number, optional) \u2014 X position (default: 0)
621
- y (number, optional) \u2014 Y position (default: 0)
716
+ Example: frames(method:"create", type:"svg", items:[{name:"Logo Mark", svg:"<svg width=\\"24\\" height=\\"24\\"><path d=\\"M4 4h16v16H4z\\" fill=\\"currentColor\\"/></svg>", fillVariableName:"icon/primary"}])
717
+ Item fields for items[] when type:"svg":
718
+ fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
719
+ fillVariableName (string, optional) \u2014 Color variable by name for vector fills
720
+ strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
721
+ strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes
722
+ svg (string, required) \u2014 SVG markup string
723
+ name (string, optional) \u2014 Layer name (default: 'SVG')
724
+ parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
725
+ x (number, optional) \u2014 X position (default: 0)
726
+ y (number, optional) \u2014 Y position (default: 0)
622
727
 
623
728
  ## slot \u2014 Create a slot inside a component. Slots are placeholder containers that instance users fill with content. Defaults to VERTICAL auto-layout with FILL/HUG sizing \u2014 ready to receive children. Accepts all frame layout properties.
624
- name (string, optional) \u2014 Node name
625
- parentId (string, optional) \u2014 Parent node ID inside the owning component. Required unless componentId is provided.
626
- x (number, optional) \u2014 X position (default: 0)
627
- y (number, optional) \u2014 Y position (default: 0)
628
- width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
629
- height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
630
- rotation (number, optional) \u2014 Rotation in degrees (0-360)
631
- visible (boolean, optional) \u2014 Show/hide (default true)
632
- locked (boolean, optional) \u2014 Lock/unlock (default false)
633
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
634
- blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
635
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
636
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
637
- fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
638
- fillStyleName (string, optional) \u2014 Paint style name for fill
639
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
640
- imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
641
- imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
642
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
643
- strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
644
- strokeStyleName (string, optional) \u2014 Paint style name for stroke
645
- strokeVariableName (string, optional) \u2014 Color variable by name for stroke
646
- strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
647
- strokeTopWeight (string, optional)
648
- strokeBottomWeight (string, optional)
649
- strokeLeftWeight (string, optional)
650
- strokeRightWeight (string, optional)
651
- strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
652
- cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
653
- topLeftRadius (string, optional)
654
- topRightRadius (string, optional)
655
- bottomRightRadius (string, optional)
656
- bottomLeftRadius (string, optional)
657
- layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
658
- layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
659
- padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
660
- paddingTop (string, optional)
661
- paddingRight (string, optional)
662
- paddingBottom (string, optional)
663
- paddingLeft (string, optional)
664
- primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
665
- counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
666
- itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
667
- counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
668
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
669
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
670
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
671
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
672
- layoutSizingVertical (FIXED | HUG | FILL, optional)
673
- minWidth (number, optional) \u2014 Min width for responsive auto-layout
674
- maxWidth (number, optional) \u2014 Max width for responsive auto-layout
675
- minHeight (number, optional) \u2014 Min height for responsive auto-layout
676
- maxHeight (number, optional) \u2014 Max height for responsive auto-layout
677
- annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
678
- componentId (string, optional) \u2014 Owning component ID. Optional \u2014 auto-resolved from parentId by walking up ancestors.`,
679
- "commit": '# frames.commit\nCommit a staged node \u2014 unwraps from [STAGED] container into the original target location.\n\nExample: frames(method:"commit", id:"1:234")\n\nParams:\n id (string, required) \u2014 Staged node ID to commit',
680
- "export": "# frames.export\nExport a node as PNG, JPG, SVG, SVG_STRING, or PDF\n\nParams:\n id (string, required) \u2014 Node ID to export\n format (PNG | JPG | SVG | SVG_STRING | PDF, optional) \u2014 Export format (default: PNG). SVG_STRING returns raw SVG text.\n scale (number, optional) \u2014 Export scale (default: 1, only for PNG/JPG)"
729
+ Example: frames(method:"create", type:"slot", items:[{componentId:"1:23", name:"Content Slot", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}])
730
+ Item fields for items[] when type:"slot":
731
+ name (string, optional) \u2014 Node name
732
+ parentId (string, optional) \u2014 Parent node ID inside the owning component. Required unless componentId is provided.
733
+ x (number, optional) \u2014 X position (default: 0)
734
+ y (number, optional) \u2014 Y position (default: 0)
735
+ width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
736
+ height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
737
+ rotation (number, optional) \u2014 Rotation in degrees (0-360)
738
+ visible (boolean, optional) \u2014 Show/hide (default true)
739
+ locked (boolean, optional) \u2014 Lock/unlock (default false)
740
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
741
+ blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
742
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
743
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
744
+ fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
745
+ fillStyleName (string, optional) \u2014 Paint style name for fill
746
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
747
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
748
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
749
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
750
+ strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
751
+ strokeStyleName (string, optional) \u2014 Paint style name for stroke
752
+ strokeVariableName (string, optional) \u2014 Color variable by name for stroke
753
+ strokeWeight (string, optional) \u2014 All sides (number) or variable name (string). Per-side: strokeTopWeight, strokeBottomWeight, strokeLeftWeight, strokeRightWeight.
754
+ strokeTopWeight (string, optional)
755
+ strokeBottomWeight (string, optional)
756
+ strokeLeftWeight (string, optional)
757
+ strokeRightWeight (string, optional)
758
+ strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
759
+ cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
760
+ topLeftRadius (string, optional)
761
+ topRightRadius (string, optional)
762
+ bottomRightRadius (string, optional)
763
+ bottomLeftRadius (string, optional)
764
+ layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
765
+ layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
766
+ padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
767
+ paddingTop (string, optional)
768
+ paddingRight (string, optional)
769
+ paddingBottom (string, optional)
770
+ paddingLeft (string, optional)
771
+ primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
772
+ counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
773
+ itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
774
+ counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
775
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
776
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
777
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
778
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
779
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
780
+ minWidth (number, optional) \u2014 Min width for responsive auto-layout
781
+ maxWidth (number, optional) \u2014 Max width for responsive auto-layout
782
+ minHeight (number, optional) \u2014 Min height for responsive auto-layout
783
+ maxHeight (number, optional) \u2014 Max height for responsive auto-layout
784
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
785
+ componentId (string, optional) \u2014 Owning component ID. Optional \u2014 auto-resolved from parentId by walking up ancestors.
786
+
787
+ Response:
788
+ { results: ({id} | {error})[] }
789
+ // Shared types:
790
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
791
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
792
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
793
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
794
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
795
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
796
+ // Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}
797
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
798
+ "commit": '# frames.commit\nCommit a staged node \u2014 unwraps from [STAGED] container into the original target location.\n\nExample: frames(method:"commit", id:"1:234")\n\nParams:\n id (string, required) \u2014 Staged node ID to commit\n\nResponse:\n { results: ({id} | {error})[] }',
799
+ "export": "# frames.export\nExport a node as PNG, JPG, SVG, SVG_STRING, or PDF\n\nParams:\n id (string, required) \u2014 Node ID to export\n format (PNG | JPG | SVG | SVG_STRING | PDF, optional) \u2014 Export format (default: PNG). SVG_STRING returns raw SVG text.\n scale (number, optional) \u2014 Export scale (default: 1, only for PNG/JPG)\n\nResponse:\n Binary image data returned as MCP image content (SVG_STRING returns text)\n imageData (string, optional)\n mimeType (string, optional)"
681
800
  }
682
801
  },
683
802
  "icons": {
684
803
  "summary": '# icons\nSearch and create icons from 200k+ open-source icons via Iconify.\n\nMethods:\n search Search icons by keyword across all Iconify sets [read]\n collections List available Iconify icon sets [read]\n create Create an icon node in Figma from an Iconify icon name [create]\n\n// Icons are fetched from the Iconify API (iconify.design) and inserted as SVG vector nodes.\n// Icon names use "prefix:name" format. Common sets: lucide, mdi, tabler, heroicons, ph.\n// Examples: "lucide:home", "mdi:account-circle", "tabler:arrow-right", "ph:gear-bold"\n// Use search to discover icons by keyword. Use collections to list available icon sets.\n// create fetches the SVG and inserts it via frames.create \u2014 auto-detects fill vs stroke icons.\n// Use colorVariableName (not fillVariableName/strokeVariableName) \u2014 the handler applies to whichever channel has paint.\n// Fetched icons are cached in memory for the session (same icon+size is fetched once).\n// Powered by Iconify (iconify.design) \u2014 open-source icon framework.\n\nUse icons(method: "help", topic: "<method>") for method details.',
685
804
  "methods": {
686
- "search": '# icons.search\nSearch icons by keyword across all Iconify sets\n\nExample: icons(method:"search", query:"arrow right", prefix:"lucide")\n\nParams:\n query (string, required) \u2014 Search keyword (e.g. "home", "arrow", "user")\n prefix (string, optional) \u2014 Restrict to one icon set (e.g. "lucide", "mdi")\n limit (number, optional) \u2014 Max results (default 64)',
687
- "collections": '# icons.collections\nList available Iconify icon sets\n\nExample: icons(method:"collections", category:"UI 24px", limit:10)\n\nParams:\n query (string, optional) \u2014 Filter by name or prefix (e.g. "lucide", "material")\n category (string, optional) \u2014 Filter by category (e.g. "UI 24px", "Logos", "Emoji")\n limit (number, optional) \u2014 Max results (default: all)',
805
+ "search": '# icons.search\nSearch icons by keyword across all Iconify sets\n\nExample: icons(method:"search", query:"arrow right", prefix:"lucide")\n\nParams:\n query (string, required) \u2014 Search keyword (e.g. "home", "arrow", "user")\n prefix (string, optional) \u2014 Restrict to one icon set (e.g. "lucide", "mdi")\n limit (number, optional) \u2014 Max results (default 64)\n\nResponse:\n icons (string[], optional) \u2014 Icon names (e.g. ["lucide:home", "mdi:home"])\n total (number, optional) \u2014 Total matching icons',
806
+ "collections": '# icons.collections\nList available Iconify icon sets\n\nExample: icons(method:"collections", category:"UI 24px", limit:10)\n\nParams:\n query (string, optional) \u2014 Filter by name or prefix (e.g. "lucide", "material")\n category (string, optional) \u2014 Filter by category (e.g. "UI 24px", "Logos", "Emoji")\n limit (number, optional) \u2014 Max results (default: all)\n\nResponse:\n Array of icon set metadata\n collections (array, optional) \u2014 [{ prefix, name, total, category, license }]\n total (number, optional) \u2014 Total matching collections (before limit)',
688
807
  "create": `# icons.create
689
808
  Create an icon node in Figma from an Iconify icon name
690
809
 
@@ -698,7 +817,18 @@ Params:
698
817
  x (number, optional) \u2014 X position (default: 0)
699
818
  y (number, optional) \u2014 Y position (default: 0)
700
819
  colorVariableName (string, optional) \u2014 Color variable for the icon \u2014 auto-detects fill vs stroke (e.g. 'text/primary')
701
- colorStyleName (string, optional) \u2014 Paint style for the icon \u2014 auto-detects fill vs stroke (e.g. 'Icon/Primary')`
820
+ colorStyleName (string, optional) \u2014 Paint style for the icon \u2014 auto-detects fill vs stroke (e.g. 'Icon/Primary')
821
+
822
+ Response:
823
+ { results: ({id} | {error})[] }
824
+ // Shared types:
825
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
826
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
827
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
828
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
829
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
830
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
831
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`
702
832
  }
703
833
  },
704
834
  "images": {
@@ -716,16 +846,36 @@ Params:
716
846
  color (string, optional) \u2014 Filter by color \u2014 hex (e.g. '#FF0000') or named: red, orange, yellow, green, turquoise, blue, violet, pink, brown, black, gray, white
717
847
  locale (string, optional) \u2014 Locale for search (e.g. 'en-US', 'ja-JP'). Default: en-US
718
848
  page (number, optional) \u2014 Page number for pagination (default: 1)
719
- per_page (number, optional) \u2014 Results per page (default: 15, max: 80)`,
720
- "preview": '# images.preview\nPreview a photo by ID \u2014 returns the image so you can see it before placing\n\nExample: images(method:"preview", id:12345)\n\nParams:\n id (number, required) \u2014 Photo ID from search results\n size (small | medium | large, optional) \u2014 Preview size (default: medium). small\u2248130px, medium\u2248350px, large\u2248940px height'
849
+ per_page (number, optional) \u2014 Results per page (default: 15, max: 80)
850
+
851
+ Response:
852
+ photos (array, optional) \u2014 [{ id, alt, avg_color, width, height }]
853
+ total_results (number, optional) \u2014 Total matching photos
854
+ page (number, optional)
855
+ per_page (number, optional)`,
856
+ "preview": '# images.preview\nPreview a photo by ID \u2014 returns the image so you can see it before placing\n\nExample: images(method:"preview", id:12345)\n\nParams:\n id (number, required) \u2014 Photo ID from search results\n size (small | medium | large, optional) \u2014 Preview size (default: medium). small\u2248130px, medium\u2248350px, large\u2248940px height\n\nResponse:\n The photo as a visual image preview\n image'
721
857
  }
722
858
  },
723
859
  "instances": {
724
- "summary": '# instances\nCreate and manage component instances.\n\nMethods:\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n get Get instance detail with component properties and overrides [read]\n create Create component instances [create]\n update Set instance properties [edit]\n swap Swap instance component (preserves overrides) [edit]\n detach Detach instances from their component (converts to frame) [edit]\n reset_overrides Reset all overrides on instances to match their main component [edit]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// properties: escape hatch \u2014 set any Figma node property directly. Use only when no dedicated field exists.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}}\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.\n// Unknown keys produce a warning, preventing silent failures.\n// Instances are linked copies of components. Changes to the component propagate to all instances.\n// Overrides: instance-level changes (text, fills, visibility) that differ from the component. Shown in overrides array.\n// variantProperties: when creating from a component set, pick which variant e.g. {"Style":"Secondary","Size":"Large"}.\n// ---\n// Property keys: read returns clean names ("Label"), write requires the #suffix ("Label#1:0"). Call instances.get(id) to discover exact keys before update.\n// swap: change which component an instance points to while preserving compatible overrides.\n// detach: permanently converts an instance to a regular frame, breaking the component link.\n// reset_overrides: reverts all instance overrides to match the main component.\n// Workflow (local components): components.list \u2192 instances.create with componentId + properties (one call).\n// Workflow (external/published libraries): library(method:"components", query:"...") \u2192 instances.create with componentName + properties. The MCP resolves componentName \u2192 key and imports via figma.importComponentByKeyAsync \u2014 the raw key never enters agent context.\n// Instances support frame-level overrides: layoutSizingHorizontal/Vertical (FIXED, FILL, HUG), opacity, width/height, min/max.\n// Use layoutSizingHorizontal: "FILL" to make instances stretch in auto-layout parents.\n\nUse instances(method: "help", topic: "<method>") for method details.',
860
+ "summary": '# instances\nCreate and manage component instances.\n\nMethods:\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n scale Proportionally rescale a node subtree using Figma\'s visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing. [edit]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n get Get instance detail with component properties and overrides [read]\n create Create component instances [create]\n update Set instance properties [edit]\n swap Swap instance component (preserves overrides) [edit]\n detach Detach instances from their component (converts to frame) [edit]\n reset_overrides Reset all overrides on instances to match their main component [edit]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// clipsContent: clip children to the node bounds where supported (frames/components/instances). Set false for overflow-visible layouts.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // readback Paint[]; authoring supports SOLID + gradients via gradientTransform + gradientStops\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create. Paint[] authoring supports SOLID + gradients only; IMAGE/VIDEO/PATTERN are readback-only metadata.\n// Unknown keys produce a warning, preventing silent failures.\n// Instances are linked copies of components. Changes to the component propagate to all instances.\n// Overrides: instance-level changes (text, fills, visibility) that differ from the component. Shown in overrides array.\n// variantProperties: when creating from a component set, pick which variant e.g. {"Style":"Secondary","Size":"Large"}.\n// ---\n// Property keys: read returns clean names ("Label"), write requires the #suffix ("Label#1:0"). Call instances.get(id) to discover exact keys before update.\n// swap: change which component an instance points to while preserving compatible overrides.\n// detach: permanently converts an instance to a regular frame, breaking the component link.\n// reset_overrides: reverts all instance overrides to match the main component.\n// Workflow (local components): components.list \u2192 instances.create with componentId + properties (one call).\n// Workflow (external/published libraries): library(method:"components", query:"...") \u2192 instances.create with componentName + properties. The MCP resolves componentName \u2192 key and imports via figma.importComponentByKeyAsync \u2014 the raw key never enters agent context.\n// Instances support frame-level overrides: layoutSizingHorizontal/Vertical (FIXED, FILL, HUG), opacity, width/height, min/max.\n// Use layoutSizingHorizontal: "FILL" to make instances stretch in auto-layout parents.\n\nUse instances(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// NodeStub: {id: string, name: string, type: string}',
725
861
  "methods": {
726
- "list": '# instances.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
727
- "delete": "# instances.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)",
728
- "clone": "# instances.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
862
+ "list": '# instances.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n Paginated node search results (uses `results` not `items`)\n totalCount (number, required) \u2014 Total matching nodes\n returned (number, required) \u2014 Nodes in this page\n offset (number, optional)\n limit (number, optional)\n results (array, required) \u2014 Matching node stubs\n id (string, required)\n name (string, required)\n type (string, required)\n parentId (string, required)\n parentName (string, optional)\n bounds (object, optional)',
863
+ "delete": '# instances.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
864
+ "clone": "# instances.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n\nResponse:\n { results: ({id} | {error})[] }",
865
+ "scale": `# instances.scale
866
+ Proportionally rescale a node subtree using Figma's visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing.
867
+
868
+ Example: instances(method:"scale", id:"1:23", factor:0.5)
869
+
870
+ Params:
871
+ id (string, optional) \u2014 Node ID to scale
872
+ factor (number, optional) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%. Scales children, text, strokes, effects, and layout geometry from the node's top-left. On auto-layout or HUG/FILL nodes, Figma may resolve responsive sizing to fixed width/height.
873
+ items (array, optional) \u2014 Batch: [{id, factor}, ...]. Alternative to single-item params.
874
+ id (string, required) \u2014 Node ID to scale
875
+ factor (number, required) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%.
876
+
877
+ Response:
878
+ { results: ("ok" | {error})[] }`,
729
879
  "audit": `# instances.audit
730
880
  Run lint on a node \u2014 returns severity-ranked findings
731
881
 
@@ -735,13 +885,18 @@ Params:
735
885
  maxDepth (number, optional) \u2014 Max tree depth (default: 10)
736
886
  maxFindings (number, optional) \u2014 Max findings (default: 50)
737
887
  minSeverity (error | unsafe | heuristic | style | verbose, optional) \u2014 Minimum severity to report (default: style). Set to 'verbose' to include AAA contrast and line-height checks.
738
- skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
739
- "reparent": "# instances.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)",
740
- "get": '# instances.get\nGet instance detail with component properties and overrides\n\nParams:\n id (string, required) \u2014 Instance node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.',
888
+ skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)
889
+
890
+ Response:
891
+ nodeId (string, optional)
892
+ nodeName (string, optional)
893
+ categories (array, optional) \u2014 Sorted by severity (error > unsafe > heuristic > style)`,
894
+ "reparent": '# instances.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
895
+ "get": '# instances.get\nGet instance detail with component properties and overrides\n\nParams:\n id (string, required) \u2014 Instance node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.\n\nResponse:\n results (array, required) \u2014 Serialized node(s) with componentProperties, overrides\n _truncated (boolean, optional)',
741
896
  "create": `# instances.create
742
897
  Create component instances
743
898
 
744
- Example: instances(method:"create", items:[{componentName:"Button", variantProperties:{"Size":"Large"}, properties:{"Label":"Click me"}, parentId:"2:45", layoutSizingHorizontal:"FILL"}]) // or componentId:"1:23" for a local component
899
+ Example: instances(method:"create", items:[{componentId:"1:23", variantProperties:{"Style":"Primary"}, properties:{"Button":"Click me"}, x:320, y:0}])
745
900
 
746
901
  Params:
747
902
  items (InstanceCreateItem[], required) \u2014 Array of {componentId, variantProperties?, x?, y?, parentId?, layoutSizingHorizontal?, ...}
@@ -770,19 +925,25 @@ Params:
770
925
  height (number, optional) \u2014 Override height (resize)
771
926
  explicitMode (object, optional) \u2014 Pin variable mode at creation \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }. Useful for library components with Light/Dark modes.
772
927
  parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
773
- depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.`,
928
+ depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.
929
+
930
+ Response:
931
+ { results: ({id} | {error})[] }
932
+ // Shared types:
933
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
934
+ // Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}`,
774
935
  "update": `# instances.update
775
936
  Set instance properties
776
937
 
777
- Example: instances(method:"update", items:[{id:"1:23", properties:{"Label#4:0":"Submit"}, fillColor:"#3B82F6", layoutSizingHorizontal:"FILL"}])
938
+ Example: instances(method:"update", items:[{id:"1:23", properties:{"Button#4:0":"Submit"}, fillVariableName:"bg/accent"}])
778
939
 
779
940
  Params:
780
- items (InstanceUpdateItem[], required) \u2014 Array of {id, properties: {"Label#1:0":"text"}, fillColor?: ...}
781
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
941
+ items (InstanceUpdateItem[], required) \u2014 Array of {id, properties: {"Property#1:0":"text"}, fillVariableName?: ...}. Use components.get on the source component to discover exact property keys.
942
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
782
943
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
783
944
  fillStyleName (string, optional) \u2014 Paint style name for fill
784
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
785
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
945
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
946
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
786
947
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
787
948
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
788
949
  strokeVariableName (string, optional) \u2014 Color variable by name for stroke
@@ -854,10 +1015,22 @@ Params:
854
1015
  variableName (string, optional)
855
1016
  variableId (string, optional)
856
1017
  explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
857
- exportSettings (array, optional) \u2014 Export settings`,
858
- "swap": "# instances.swap\nSwap instance component (preserves overrides)\n\nParams:\n items (array, required) \u2014 Array of {id, componentId}\n id (string, required) \u2014 Instance node ID\n componentId (string, required) \u2014 New component or component set ID",
859
- "detach": "# instances.detach\nDetach instances from their component (converts to frame)\n\nParams:\n items (array, required) \u2014 Array of {id}\n id (string, required) \u2014 Instance node ID",
860
- "reset_overrides": "# instances.reset_overrides\nReset all overrides on instances to match their main component\n\nParams:\n items (array, required) \u2014 Array of {id}\n id (string, required) \u2014 Instance node ID"
1018
+ exportSettings (array, optional) \u2014 Export settings
1019
+
1020
+ Response:
1021
+ { results: ("ok" | {error} | object)[] }
1022
+ // Shared types:
1023
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
1024
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
1025
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
1026
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
1027
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
1028
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
1029
+ // Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}
1030
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
1031
+ "swap": '# instances.swap\nSwap instance component (preserves overrides)\n\nParams:\n items (array, required) \u2014 Array of {id, componentId}\n id (string, required) \u2014 Instance node ID\n componentId (string, required) \u2014 New component or component set ID\n\nResponse:\n { results: ("ok" | {error} | object)[] }',
1032
+ "detach": "# instances.detach\nDetach instances from their component (converts to frame)\n\nParams:\n items (array, required) \u2014 Array of {id}\n id (string, required) \u2014 Instance node ID\n\nResponse:\n { results: ({id} | {error})[] }",
1033
+ "reset_overrides": '# instances.reset_overrides\nReset all overrides on instances to match their main component\n\nParams:\n items (array, required) \u2014 Array of {id}\n id (string, required) \u2014 Instance node ID\n\nResponse:\n { results: ("ok" | {error} | object)[] }'
861
1034
  }
862
1035
  },
863
1036
  "library": {
@@ -907,7 +1080,16 @@ Example: library(method:"list") // uses FIGMA_TEAM_ID env var; or pass file/tea
907
1080
 
908
1081
  Params:
909
1082
  file (string, optional) \u2014 File URL or file key \u2014 e.g. 'https://www.figma.com/design/abc123/MyDS' or 'abc123'
910
- team (string, optional) \u2014 Team URL or team ID. Falls back to FIGMA_TEAM_ID env var if omitted.`,
1083
+ team (string, optional) \u2014 Team URL or team ID. Falls back to FIGMA_TEAM_ID env var if omitted.
1084
+
1085
+ Response:
1086
+ libraries (array, optional) \u2014 Components, sets, and styles grouped by source Figma file (library) and then by section \u2014 the same hierarchy designers see in Figma's Libraries browser. Use the library name to pick the intended kit when multiple libraries expose overlapping names (e.g. two files both defining 'Item' or 'Header'), and use section names to locate components semantically (e.g. the 'Sidebars' section contains the proper sidebar Item and Section Header, distinct from a List 'Item' row).
1087
+ name (string, optional) \u2014 Display name of the source Figma file.
1088
+ sections (array, optional) \u2014 Sections within the library, mirroring the headings designers see in Figma's Libraries panel. Usually correspond to containing frames or pages in the source file.
1089
+ name (string, optional) \u2014 Section heading \u2014 e.g. 'Sidebars', 'Windows', 'Buttons'. '(unsectioned)' when the source component is not inside a named frame.
1090
+ components (array, optional) \u2014 Non-variant component names in this section. Reference by name in instances.create via componentName.
1091
+ componentSets (array, optional) \u2014 Variant set names in this section. Use with variantProperties in instances.create.
1092
+ styles (object, optional) \u2014 Published styles in this section, grouped by type.`,
911
1093
  "get": `# library.get
912
1094
  Get rich details for components matching one or more queries. Returns nested libraries \u2192 sections \u2192 entries (same hierarchy as list) with properties, variant options, defaults, and a copy-pasteable usage hint at each leaf.
913
1095
 
@@ -918,7 +1100,16 @@ Params:
918
1100
  library (string, optional) \u2014 Optional source library (Figma file) name filter \u2014 case-insensitive substring. Use when multiple imported libraries expose overlapping component names (e.g. two files both defining 'Item'). Match the name returned under list \u2192 libraries[].name.
919
1101
  section (string, optional) \u2014 Optional section name filter \u2014 case-insensitive substring. Matches the containing frame / section headers returned under list \u2192 libraries[].sections[].name (e.g. 'Sidebars', 'Windows', 'List'). Combine with library for maximum precision.
920
1102
  file (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.
921
- team (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.`
1103
+ team (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.
1104
+
1105
+ Response:
1106
+ libraries (array, optional) \u2014 Matching entries nested by source library and section \u2014 same hierarchy as list, but each leaf is a full detail object (properties, variant options, defaults, usage hint) instead of a bare name.
1107
+ name (string, optional) \u2014 Source Figma file name.
1108
+ sections (array, optional)
1109
+ name (string, optional) \u2014 Section heading (containing frame). '(unsectioned)' when absent.
1110
+ components (array, optional) \u2014 Non-variant components in this section with full detail. Each entry: { name, kind, description?, properties?, usage? } \u2014 properties is { [propName]: { type: VARIANT|TEXT|BOOLEAN|INSTANCE_SWAP, defaultValue?, options? } } matching components.get. usage is a copy-pasteable instances.create snippet.
1111
+ componentSets (array, optional) \u2014 Variant component sets in this section with full detail, same shape as components above. VARIANT properties carry options; pair with TEXT/BOOLEAN properties via instances.create.
1112
+ styles (object, optional) \u2014 Published styles in this section, grouped by type. Each entry: { name, kind: 'style', styleType, description? } (no properties/usage \u2014 styles have no variants).`
922
1113
  }
923
1114
  },
924
1115
  "lint": {
@@ -957,6 +1148,7 @@ Methods:
957
1148
  // "shape-instead-of-frame" \u2014 shapes used as containers [style]
958
1149
  // "fixed-in-autolayout" \u2014 FIXED-size children in auto-layout parents [heuristic]
959
1150
  // "unbounded-hug" \u2014 HUG on both axes [unsafe; short leaf text\u2192style]
1151
+ // "fill-in-hug" \u2014 collapsed FILL on the same axis inside a HUG parent (existing anchored states may be valid) [unsafe]
960
1152
  // "hug-cross-axis" \u2014 HUG on cross-axis of constrained parent [heuristic; leaf nodes\u2192style]
961
1153
  // "empty-container" \u2014 empty frames, excludes SLOT nodes [style]
962
1154
  // Token rules [token]:
@@ -990,51 +1182,90 @@ Params:
990
1182
  maxDepth (number, optional) \u2014 Max tree depth (default: 10)
991
1183
  maxFindings (number, optional) \u2014 Max findings (default: 50)
992
1184
  minSeverity (error | unsafe | heuristic | style | verbose, optional) \u2014 Minimum severity to report (default: style). Set to 'verbose' to include AAA contrast and line-height checks.
993
- skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
994
- "fix": "# lint.fix\nAuto-fix frames to auto-layout\n\nParams:\n items (array, required) \u2014 Array of {nodeId, layoutMode?, itemSpacing?}\n nodeId (string, required) \u2014 Frame node ID\n layoutMode (VERTICAL | HORIZONTAL, optional) \u2014 Direction (default: auto-detected)\n itemSpacing (number, optional) \u2014 Spacing between children\n depth (number, optional) \u2014 Response detail for fixed nodes: omit for stubs, 0=properties, -1=full tree"
1185
+ skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)
1186
+
1187
+ Response:
1188
+ nodeId (string, required)
1189
+ nodeName (string, required)
1190
+ categories (array, required) \u2014 Sorted by severity (error > unsafe > heuristic > style)
1191
+ rule (string, required)
1192
+ severity (string, required) \u2014 error | unsafe | heuristic | style
1193
+ category (string, required) \u2014 component | composition | token | accessibility | naming
1194
+ count (number, required)
1195
+ fix (string, required)
1196
+ nodes (array, required)
1197
+ id (string, required)
1198
+ name (string, required)
1199
+ severity (string, optional) \u2014 Per-finding override when context changes the default
1200
+ warning (string, optional)`,
1201
+ "fix": '# lint.fix\nAuto-fix frames to auto-layout\n\nParams:\n items (array, required) \u2014 Array of {nodeId, layoutMode?, itemSpacing?}\n nodeId (string, required) \u2014 Frame node ID\n layoutMode (VERTICAL | HORIZONTAL, optional) \u2014 Direction (default: auto-detected)\n itemSpacing (number, optional) \u2014 Spacing between children\n depth (number, optional) \u2014 Response detail for fixed nodes: omit for stubs, 0=properties, -1=full tree\n\nResponse:\n { results: ("ok" | {error} | object)[] }'
995
1202
  }
996
1203
  },
997
1204
  "prototyping": {
998
1205
  "summary": '# prototyping\nManage prototype interactions, reactions, and navigation flows.\n\nMethods:\n get Get reactions and overflow direction on a node [read]\n add Add a prototype reaction to a node [edit]\n set Replace all reactions on a node (raw reactions array) [edit]\n remove Remove a reaction from a node by index [edit]\n\n// Reactions wire up interactions: trigger (ON_CLICK, ON_HOVER, ...) \u2192 action (navigate, swap, overlay).\n// Common patterns: button ON_CLICK \u2192 NAVIGATE to detail frame; card ON_HOVER \u2192 CHANGE_TO hover variant.\n// Multi-action: pass actions[] array to run multiple actions on one trigger (e.g. navigate + set variable mode).\n// ---\n// IMPORTANT: destination rules depend on navigation type:\n// NAVIGATE/SWAP/OVERLAY/SCROLL_TO \u2192 destination must be a top-level frame (direct child of a page). Nested frames are rejected.\n// CHANGE_TO \u2192 destination must be a variant (COMPONENT inside a COMPONENT_SET). Used for hover/state swaps within the same component.\n// ---\n// TRIGGERS: ON_CLICK | ON_HOVER | ON_PRESS | ON_DRAG | AFTER_TIMEOUT(timeout) | MOUSE_ENTER(delay) | MOUSE_LEAVE(delay) | ON_KEY_DOWN(keyCodes)\n// NAVIGATION: NAVIGATE (go to frame) | SWAP (swap overlay) | OVERLAY (show overlay) | SCROLL_TO | CHANGE_TO (swap component variant)\n// TRANSITIONS: DISSOLVE | SMART_ANIMATE | MOVE_IN | MOVE_OUT | PUSH | SLIDE_IN | SLIDE_OUT (+ direction for directional)\n// EASING: EASE_IN | EASE_OUT | EASE_IN_AND_OUT | LINEAR | GENTLE | QUICK | BOUNCY | SLOW\n// ACTIONS: NODE (navigate/swap) | BACK (go back) | CLOSE (close overlay) | URL (open link) | SET_VARIABLE_MODE (switch theme/mode)\n\nUse prototyping(method: "help", topic: "<method>") for method details.',
999
1206
  "methods": {
1000
- "get": "# prototyping.get\nGet reactions and overflow direction on a node\n\nParams:\n id (string, required) \u2014 Node ID",
1001
- "add": '# prototyping.add\nAdd a prototype reaction to a node\n\nExample: prototyping(method:"add", items:[{id:"btn-1", trigger:"ON_CLICK", destination:"frame-2", navigation:"NAVIGATE", transition:"SMART_ANIMATE"}, {id:"btn-2", trigger:"ON_CLICK", destination:"frame-3"}])\n\nParams:\n id (string, optional) \u2014 Node ID\n trigger (ON_CLICK | ON_HOVER | ON_PRESS | ON_DRAG | AFTER_TIMEOUT | MOUSE_ENTER | MOUSE_LEAVE | ON_KEY_DOWN, optional) \u2014 Trigger type\n triggerDelay (number, optional) \u2014 Delay in ms for AFTER_TIMEOUT / MOUSE_ENTER / MOUSE_LEAVE triggers\n triggerKeyCodes (number[], optional) \u2014 Key codes for ON_KEY_DOWN trigger\n triggerDevice (KEYBOARD | XBOX_ONE | PS4 | SWITCH_PRO, optional) \u2014 Device for ON_KEY_DOWN (default: KEYBOARD)\n destination (string, optional) \u2014 Target node ID (required for NODE actions). NAVIGATE/SWAP/OVERLAY: must be a top-level frame. CHANGE_TO: must be a variant (component inside a component set).\n navigation (NAVIGATE | SWAP | OVERLAY | SCROLL_TO | CHANGE_TO, optional) \u2014 Navigation type (default: NAVIGATE)\n transition (DISSOLVE | SMART_ANIMATE | MOVE_IN | MOVE_OUT | PUSH | SLIDE_IN | SLIDE_OUT | INSTANT, optional) \u2014 Transition animation (default: DISSOLVE). INSTANT = no animation.\n transitionDirection (LEFT | RIGHT | TOP | BOTTOM, optional) \u2014 Direction for MOVE_IN, MOVE_OUT, PUSH, SLIDE_IN, SLIDE_OUT\n duration (number, optional) \u2014 Transition duration in seconds (default: 0.3)\n easing (EASE_IN | EASE_OUT | EASE_IN_AND_OUT | LINEAR | GENTLE | QUICK | BOUNCY | SLOW, optional) \u2014 Easing function (default: EASE_OUT)\n actionType (NODE | BACK | CLOSE | URL | SET_VARIABLE_MODE, optional) \u2014 Action type (default: NODE). SET_VARIABLE_MODE switches a variable collection mode.\n url (string, optional) \u2014 URL for URL action type\n collectionName (string, optional) \u2014 Variable collection name (for SET_VARIABLE_MODE)\n modeName (string, optional) \u2014 Mode name to switch to (for SET_VARIABLE_MODE)\n resetScrollPosition (boolean, optional) \u2014 Reset scroll position on navigate (default: true)\n actions (array, optional) \u2014 Multi-action: [{actionType, destination?, navigation?, collectionName?, modeName?, ...}]. Overrides single-action params.\n items (array, optional) \u2014 Batch: array of {id, trigger, destination?, ...} reaction items\n id (string, required) \u2014 Node ID\n trigger (ON_CLICK | ON_HOVER | ON_PRESS | ON_DRAG | AFTER_TIMEOUT | MOUSE_ENTER | MOUSE_LEAVE | ON_KEY_DOWN, required) \u2014 Trigger type\n destination (string, optional) \u2014 Target node ID\n navigation (NAVIGATE | SWAP | OVERLAY | SCROLL_TO | CHANGE_TO, optional)\n transition (DISSOLVE | SMART_ANIMATE | MOVE_IN | MOVE_OUT | PUSH | SLIDE_IN | SLIDE_OUT | INSTANT, optional)\n transitionDirection (LEFT | RIGHT | TOP | BOTTOM, optional)\n duration (number, optional)\n easing (EASE_IN | EASE_OUT | EASE_IN_AND_OUT | LINEAR | GENTLE | QUICK | BOUNCY | SLOW, optional)\n actionType (NODE | BACK | CLOSE | URL | SET_VARIABLE_MODE, optional)\n triggerDelay (number, optional)\n url (string, optional)\n collectionName (string, optional)\n modeName (string, optional)\n resetScrollPosition (boolean, optional)\n actions (array, optional)',
1002
- "set": "# prototyping.set\nReplace all reactions on a node (raw reactions array)\n\nParams:\n id (string, required) \u2014 Node ID\n reactions (array, required) \u2014 Full reactions array \u2014 [{trigger:{type}, actions:[{type, destinationId, navigation, transition}]}]",
1003
- "remove": "# prototyping.remove\nRemove a reaction from a node by index\n\nParams:\n id (string, required) \u2014 Node ID\n index (number, required) \u2014 Reaction index (0-based)"
1207
+ "get": "# prototyping.get\nGet reactions and overflow direction on a node\n\nParams:\n id (string, required) \u2014 Node ID\n\nResponse:\n reactions (array, optional) \u2014 Reactions on this node\n overflowDirection (string, optional) \u2014 Overflow scroll direction (NONE, HORIZONTAL, VERTICAL, BOTH)",
1208
+ "add": '# prototyping.add\nAdd a prototype reaction to a node\n\nExample: prototyping(method:"add", items:[{id:"btn-1", trigger:"ON_CLICK", destination:"frame-2", navigation:"NAVIGATE", transition:"SMART_ANIMATE"}, {id:"btn-2", trigger:"ON_CLICK", destination:"frame-3"}])\n\nParams:\n id (string, optional) \u2014 Node ID\n trigger (ON_CLICK | ON_HOVER | ON_PRESS | ON_DRAG | AFTER_TIMEOUT | MOUSE_ENTER | MOUSE_LEAVE | ON_KEY_DOWN, optional) \u2014 Trigger type\n triggerDelay (number, optional) \u2014 Delay in ms for AFTER_TIMEOUT / MOUSE_ENTER / MOUSE_LEAVE triggers\n triggerKeyCodes (number[], optional) \u2014 Key codes for ON_KEY_DOWN trigger\n triggerDevice (KEYBOARD | XBOX_ONE | PS4 | SWITCH_PRO, optional) \u2014 Device for ON_KEY_DOWN (default: KEYBOARD)\n destination (string, optional) \u2014 Target node ID (required for NODE actions). NAVIGATE/SWAP/OVERLAY: must be a top-level frame. CHANGE_TO: must be a variant (component inside a component set).\n navigation (NAVIGATE | SWAP | OVERLAY | SCROLL_TO | CHANGE_TO, optional) \u2014 Navigation type (default: NAVIGATE)\n transition (DISSOLVE | SMART_ANIMATE | MOVE_IN | MOVE_OUT | PUSH | SLIDE_IN | SLIDE_OUT | INSTANT, optional) \u2014 Transition animation (default: DISSOLVE). INSTANT = no animation.\n transitionDirection (LEFT | RIGHT | TOP | BOTTOM, optional) \u2014 Direction for MOVE_IN, MOVE_OUT, PUSH, SLIDE_IN, SLIDE_OUT\n duration (number, optional) \u2014 Transition duration in seconds (default: 0.3)\n easing (EASE_IN | EASE_OUT | EASE_IN_AND_OUT | LINEAR | GENTLE | QUICK | BOUNCY | SLOW, optional) \u2014 Easing function (default: EASE_OUT)\n actionType (NODE | BACK | CLOSE | URL | SET_VARIABLE_MODE, optional) \u2014 Action type (default: NODE). SET_VARIABLE_MODE switches a variable collection mode.\n url (string, optional) \u2014 URL for URL action type\n collectionName (string, optional) \u2014 Variable collection name (for SET_VARIABLE_MODE)\n modeName (string, optional) \u2014 Mode name to switch to (for SET_VARIABLE_MODE)\n resetScrollPosition (boolean, optional) \u2014 Reset scroll position on navigate (default: true)\n actions (array, optional) \u2014 Multi-action: [{actionType, destination?, navigation?, collectionName?, modeName?, ...}]. Overrides single-action params.\n items (array, optional) \u2014 Batch: array of {id, trigger, destination?, ...} reaction items\n id (string, required) \u2014 Node ID\n trigger (ON_CLICK | ON_HOVER | ON_PRESS | ON_DRAG | AFTER_TIMEOUT | MOUSE_ENTER | MOUSE_LEAVE | ON_KEY_DOWN, required) \u2014 Trigger type\n destination (string, optional) \u2014 Target node ID\n navigation (NAVIGATE | SWAP | OVERLAY | SCROLL_TO | CHANGE_TO, optional)\n transition (DISSOLVE | SMART_ANIMATE | MOVE_IN | MOVE_OUT | PUSH | SLIDE_IN | SLIDE_OUT | INSTANT, optional)\n transitionDirection (LEFT | RIGHT | TOP | BOTTOM, optional)\n duration (number, optional)\n easing (EASE_IN | EASE_OUT | EASE_IN_AND_OUT | LINEAR | GENTLE | QUICK | BOUNCY | SLOW, optional)\n actionType (NODE | BACK | CLOSE | URL | SET_VARIABLE_MODE, optional)\n triggerDelay (number, optional)\n url (string, optional)\n collectionName (string, optional)\n modeName (string, optional)\n resetScrollPosition (boolean, optional)\n actions (array, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
1209
+ "set": '# prototyping.set\nReplace all reactions on a node (raw reactions array)\n\nParams:\n id (string, required) \u2014 Node ID\n reactions (array, required) \u2014 Full reactions array \u2014 [{trigger:{type}, actions:[{type, destinationId, navigation, transition}]}]\n\nResponse:\n { results: ("ok" | {error})[] }',
1210
+ "remove": '# prototyping.remove\nRemove a reaction from a node by index\n\nParams:\n id (string, required) \u2014 Node ID\n index (number, required) \u2014 Reaction index (0-based)\n\nResponse:\n { results: ("ok" | {error})[] }'
1004
1211
  }
1005
1212
  },
1006
1213
  "selection": {
1007
1214
  "summary": '# selection\nRead and set the current Figma selection.\n\nMethods:\n get Get the current selection [read]\n set Set selection to nodes and scroll viewport to show them [read]\n\n// Selection is the set of nodes currently highlighted in the Figma canvas.\n// get returns the current selection. Without depth, returns stubs ({id, name, type}). With depth=0, returns full properties.\n// _truncated: true when the response was cut short due to node budget limits. Use depth=0 or specific fields to reduce payload.\n// set replaces the entire selection AND scrolls the viewport to show the selected nodes.\n\nUse selection(method: "help", topic: "<method>") for method details.',
1008
1215
  "methods": {
1009
- "get": "# selection.get\nGet the current selection\n\nParams:\n depth (number, optional) \u2014 Child recursion depth. Omit for stubs only, 0=selected nodes' properties, -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.",
1010
- "set": '# selection.set\nSet selection to nodes and scroll viewport to show them\n\nParams:\n nodeIds (string[], required) \u2014 Array of node IDs to select. Example: ["1:2","1:3"]'
1216
+ "get": "# selection.get\nGet the current selection\n\nParams:\n depth (number, optional) \u2014 Child recursion depth. Omit for stubs only, 0=selected nodes' properties, -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.\n\nResponse:\n results (array, required)\n id (string, required)\n name (string, required)\n type (string, required)\n _truncated (boolean, optional)\n _notice (string, optional)",
1217
+ "set": '# selection.set\nSet selection to nodes and scroll viewport to show them\n\nParams:\n nodeIds (string[], required) \u2014 Array of node IDs to select. Example: ["1:2","1:3"]\n\nResponse:\n count (number, required) \u2014 Number of nodes selected\n selectedNodes (array, required)\n name (string, required)\n id (string, required)\n notFoundIds (array, optional) \u2014 IDs that could not be found'
1011
1218
  }
1012
1219
  },
1013
1220
  "styles": {
1014
- "summary": '# styles\nCRUD for local paint, text, effect, and grid styles.\n\nMethods:\n list List local styles with optional type filter [read]\n get Get full style detail by ID [read]\n create Create local styles [create]\n update Update styles by ID or name [edit]\n delete Delete styles [edit]\n\n// Styles are named, reusable design properties that can be applied to nodes. Four types:\n// paint: a named color (applied to fills/strokes), text: typography settings, effect: shadows/blurs, grid: layout grids.\n// All ID params accept both IDs and display names (case-insensitive). Use whichever you have.\n// ---\n// leadingTrim: "CAP_HEIGHT" trims line-height to cap height (tighter text boxes), "NONE" is default.\n// fontStyle: font variant name like "Bold", "Italic", "Bold Italic". Use fonts.list to find available styles.\n//\n// Effect object shape (for effect styles):\n// { type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR",\n// color?: Color, offset?: {x, y}, radius: number, spread?: number,\n// visible?: boolean, blendMode?: string }\n// DROP_SHADOW/INNER_SHADOW require color, offset, radius. LAYER_BLUR/BACKGROUND_BLUR require radius only.\n// Example: { type: "DROP_SHADOW", color: "#00000040", offset: {x:0,y:4}, radius: 8 }\n//\n// LayoutGrid object shape (for grid styles):\n// Rows/Columns: { pattern: "ROWS"|"COLUMNS", alignment: "MIN"|"MAX"|"STRETCH"|"CENTER",\n// gutterSize: number, count: number, sectionSize?: number, offset?: number, visible?: boolean, color?: Color }\n// Grid: { pattern: "GRID", sectionSize: number, visible?: boolean, color?: Color }\n// Example: { pattern: "COLUMNS", alignment: "STRETCH", gutterSize: 20, count: 12, offset: 40 }\n\nUse styles(method: "help", topic: "<method>") for method details.',
1221
+ "summary": '# styles\nCRUD for local paint, text, effect, and grid styles.\n\nMethods:\n list List local styles with optional type filter [read]\n get Get full style detail by ID [read]\n create Create local styles [create]\n update Update styles by ID or name [edit]\n delete Delete styles [edit]\n\n// Styles are named, reusable design properties that can be applied to nodes. Four types:\n// paint: named PaintStyle.paints (applied to fills/strokes), text: typography settings, effect: shadows/blurs, grid: layout grids.\n// All ID params accept both IDs and display names (case-insensitive). Use whichever you have.\n// ---\n// leadingTrim: "CAP_HEIGHT" trims line-height to cap height (tighter text boxes), "NONE" is default.\n// fontStyle: font variant name like "Bold", "Italic", "Bold Italic". Use fonts.list to find available styles.\n// Paint styles: create/update paints: Paint[] authoring accepts only SOLID and gradients (GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND).\n// Use gradientTransform + gradientStops; for a basic left-to-right gradient use gradientTransform:[[1,0,0],[0,1,0]]. Do not use CSS gradients, REST gradientHandlePositions, or top-level gradient boundVariables.\n// styles.get/list readback may include IMAGE/VIDEO/PATTERN metadata from existing Figma content, but those are readback-only and cannot be passed back to create/update Paint[] authoring. Use imageUrl/images for image authoring on nodes; VIDEO/PATTERN authoring is not supported here.\n// For VariableAlias ids in Paint[] (SOLID boundVariables.color or gradientStops[].boundVariables.color), inspect variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName where available.\n// Backward-compatible color/colorVariableName create/update shorthands still create a single SOLID paint.\n//\n// Effect object shape (for effect styles):\n// { type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR",\n// color?: Color, offset?: {x, y}, radius: number, spread?: number,\n// visible?: boolean, blendMode?: string }\n// DROP_SHADOW/INNER_SHADOW require color, offset, radius. LAYER_BLUR/BACKGROUND_BLUR require radius only.\n// Example: { type: "DROP_SHADOW", color: "#00000040", offset: {x:0,y:4}, radius: 8 }\n//\n// LayoutGrid object shape (for grid styles) follows Figma Plugin API conditional shapes:\n// Grid: { pattern:"GRID", sectionSize:number, visible?:boolean, color?:Color }\n// Rows/Columns: { pattern:"ROWS"|"COLUMNS", alignment?:"MIN"|"MAX"|"STRETCH"|"CENTER", gutterSize?:number, count?:number, offset?:number, sectionSize?:number, visible?:boolean, color?:Color }\n// Important: alignment:"STRETCH" must omit sectionSize because Figma computes stretched row/column sizes. Use sectionSize only with fixed rows/columns (MIN/MAX/CENTER) or GRID.\n// Examples: stretch columns {pattern:"COLUMNS", alignment:"STRETCH", count:12, gutterSize:24, offset:80}; fixed columns {pattern:"COLUMNS", alignment:"MIN", count:12, gutterSize:24, offset:80, sectionSize:72}; square grid {pattern:"GRID", sectionSize:8}.\n\nUse styles(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// LayoutGrid is conditional: GridLayoutGrid {pattern:"GRID", sectionSize:number, visible?:boolean, color?:Color}; RowsColsLayoutGrid {pattern:"ROWS"|"COLUMNS", alignment?:"MIN"|"MAX"|"CENTER"|"STRETCH", gutterSize?:number, count?:number, offset?:number, sectionSize?:number, visible?:boolean, color?:Color}. For alignment:"STRETCH", omit sectionSize; Figma computes stretched row/column sizes. Use sectionSize only with fixed rows/columns (MIN/MAX/CENTER) or GRID.',
1015
1222
  "methods": {
1016
- "list": '# styles.list\nList local styles with optional type filter\n\nParams:\n type (paint | text | effect | grid, optional) \u2014 Filter by style type\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
1017
- "get": '# styles.get\nGet full style detail by ID\n\nParams:\n id (string, required) \u2014 Style ID or name\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.',
1018
- "create": '# styles.create\nCreate local styles\n\nExample: styles(method:"create", type:"effect", name:"Shadow/Medium", effects:[{type:"DROP_SHADOW", color:"#00000040", offset:{x:0,y:4}, radius:8}])\n\nDiscriminant: type (paint | text | effect | grid)\n\n ## paint \u2014 Paint/color style\n name (string, required) \u2014 Style name\n color (Color, optional) \u2014 Color value. Optional when colorVariableName is provided.\n colorVariableName (string, optional) \u2014 Bind to a COLOR variable by name (style tracks the variable). Can be used alone \u2014 color is resolved from the variable.\n description (string, optional) \u2014 Style description\n\n ## text \u2014 Text style\n name (string, required) \u2014 Style name\n fontFamily (string, required) \u2014 Font family\n fontStyle (string, optional) \u2014 Font style (default: Regular)\n fontSize (number, required) \u2014 Font size\n lineHeight (number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"}, optional)\n letterSpacing (number | {value, unit: "PIXELS"|"PERCENT"}, optional)\n textCase (ORIGINAL | UPPER | LOWER | TITLE | SMALL_CAPS | SMALL_CAPS_FORCED, optional)\n textDecoration (NONE | UNDERLINE | STRIKETHROUGH, optional)\n paragraphIndent (number, optional) \u2014 Paragraph indent (px)\n paragraphSpacing (number, optional) \u2014 Paragraph spacing (px)\n leadingTrim (CAP_HEIGHT | NONE, optional) \u2014 Leading trim mode\n description (string, optional) \u2014 Style description\n\n ## effect \u2014 Effect style\n name (string, required) \u2014 Style name\n effects (array, required) \u2014 Array of Effect objects\n description (string, optional) \u2014 Style description\n\n ## grid \u2014 Grid/layout grid style\n name (string, required) \u2014 Style name\n layoutGrids (array, required) \u2014 Array of LayoutGrid objects\n description (string, optional) \u2014 Style description',
1019
- "update": '# styles.update\nUpdate styles by ID or name\n\nExample: styles(method:"update", items:[{id:"Surface/Primary", color:"#F5F5F5"}])\n\nParams:\n type (paint | text | effect | grid, optional) \u2014 Style type hint for strict validation (optional, auto-detected)\n items (PatchStyleItem[], required) \u2014 Array of {id, ...fields} to update\n id (string, required) \u2014 Style ID or name\n name (string, optional) \u2014 Rename the style\n description (string, optional) \u2014 Style description\n color (Color, optional) \u2014 New color (paint styles)\n colorVariableName (string, optional) \u2014 Bind to a COLOR variable by name (paint styles)\n fontFamily (string, optional)\n fontStyle (string, optional)\n fontSize (number, optional)\n lineHeight (number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"}, optional)\n letterSpacing (number | {value, unit: "PIXELS"|"PERCENT"}, optional)\n textCase (ORIGINAL | UPPER | LOWER | TITLE | SMALL_CAPS | SMALL_CAPS_FORCED, optional)\n textDecoration (NONE | UNDERLINE | STRIKETHROUGH, optional)\n paragraphIndent (number, optional) \u2014 Paragraph indent (px)\n paragraphSpacing (number, optional) \u2014 Paragraph spacing (px)\n leadingTrim (CAP_HEIGHT | NONE, optional)\n effects (array, optional) \u2014 Array of Effect objects\n layoutGrids (array, optional) \u2014 Array of LayoutGrid objects (grid styles)',
1020
- "delete": "# styles.delete\nDelete styles\n\nParams:\n id (string, optional) \u2014 Style ID or name\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, required) \u2014 Style ID or name"
1223
+ "list": '# styles.list\nList local styles with optional type filter\n\nParams:\n type (paint | text | effect | grid, optional) \u2014 Filter by style type\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n totalCount (number, required)\n returned (number, optional)\n offset (number, optional)\n limit (number, optional)\n items (array, required)\n id (string, required)\n name (string, required)\n type (string, required)',
1224
+ "get": `# styles.get
1225
+ Get full style detail by ID
1226
+
1227
+ Params:
1228
+ id (string, required) \u2014 Style ID or name
1229
+ fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.
1230
+
1231
+ Response:
1232
+ id (string, required)
1233
+ name (string, required)
1234
+ type (string, required) \u2014 PAINT | TEXT | EFFECT | GRID
1235
+ paints (Paint[], optional) \u2014 PaintStyle.paints for PAINT styles. Readback returns Figma Plugin API Paint[]; gradients include gradientTransform, gradientStops, opacity/blendMode, and stop boundVariables. Existing Figma content may return IMAGE/VIDEO/PATTERN metadata, but those are readback-only and cannot be passed to create/update Paint[] authoring, which accepts only SOLID and gradients.
1236
+ boundVariables (object, optional) \u2014 PaintStyle.boundVariables, e.g. {paints:[{type:'VARIABLE_ALIAS', id:'...'}]}
1237
+ fontFamily (string, optional) \u2014 Font family (TEXT styles)
1238
+ fontSize (number, optional) \u2014 Font size (TEXT styles)
1239
+ effects (array, optional) \u2014 Effects array (EFFECT styles)
1240
+ layoutGrids (array, optional) \u2014 Layout grids (GRID styles)
1241
+ // Shared types:
1242
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
1243
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
1244
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
1245
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
1246
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
1247
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
1248
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
1249
+ "create": '# styles.create\nCreate local styles\n\nExample: styles(method:"create", type:"paint", items:[{name:"Gradient/Primary", paints:[{type:"GRADIENT_LINEAR", gradientTransform:[[1,0,0],[0,1,0]], gradientStops:[{position:0,color:"#7D58ED"},{position:1,color:"#207CE5"}]}]}])\n\nCall shape: styles(method:"create", type:"<type>", items:[{...type-specific fields...}])\nDo not pass type-specific item fields at the top level; put them inside items[].\n\nDiscriminant: type (paint | text | effect | grid)\nTop-level params:\n type (paint | text | effect | grid, required) \u2014 Selects which item shape to use\n items (array, required) \u2014 One or more type-specific item objects\n\n ## paint \u2014 Paint/color style\n Example: styles(method:"create", type:"paint", items:[{name:"Surface/Primary", colorVariableName:"bg/surface"}])\n Item fields for items[] when type:"paint":\n name (string, required) \u2014 Style name\n paints (Paint[], optional) \u2014 PaintStyle.paints authoring array. Accepts only SOLID and GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND, using gradientTransform + gradientStops, opacity/blendMode, and gradientStops[].boundVariables.color. Mutually exclusive with color/colorVariableName shorthands. Do not pass IMAGE/VIDEO/PATTERN, CSS gradients, REST gradientHandlePositions, or top-level gradient boundVariables. Use imageUrl/images for image authoring on nodes; VIDEO/PATTERN authoring is not supported here. For examples call styles(method:"help", topic:"create").\n color (Color, optional) \u2014 Single-solid shorthand color. Optional when colorVariableName or paints is provided.\n colorVariableName (string, optional) \u2014 Single-solid shorthand: bind to a COLOR variable by name (style tracks the variable). Can be used alone \u2014 color is resolved from the variable.\n description (string, optional) \u2014 Style description\n\n ## text \u2014 Text style\n Example: styles(method:"create", type:"text", items:[{name:"Heading/Medium", fontFamily:"Inter", fontStyle:"Medium", fontSize:20, lineHeight:{value:28, unit:"PIXELS"}}, {name:"Body/Regular", fontFamily:"Inter", fontSize:14, lineHeight:{value:20, unit:"PIXELS"}}, {name:"Body/Medium", fontFamily:"Inter", fontStyle:"Medium", fontSize:14, lineHeight:{value:20, unit:"PIXELS"}}])\n Item fields for items[] when type:"text":\n name (string, required) \u2014 Style name\n fontFamily (string, required) \u2014 Font family\n fontStyle (string, optional) \u2014 Font style (default: Regular)\n fontSize (number, required) \u2014 Font size\n lineHeight (number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"}, optional)\n letterSpacing (number | {value, unit: "PIXELS"|"PERCENT"}, optional)\n textCase (ORIGINAL | UPPER | LOWER | TITLE | SMALL_CAPS | SMALL_CAPS_FORCED, optional)\n textDecoration (NONE | UNDERLINE | STRIKETHROUGH, optional)\n paragraphIndent (number, optional) \u2014 Paragraph indent (px)\n paragraphSpacing (number, optional) \u2014 Paragraph spacing (px)\n leadingTrim (CAP_HEIGHT | NONE, optional) \u2014 Leading trim mode\n description (string, optional) \u2014 Style description\n\n ## effect \u2014 Effect style\n Example: styles(method:"create", type:"effect", items:[{name:"Shadow/Medium", effects:[{type:"DROP_SHADOW", color:"#00000040", offset:{x:0,y:4}, radius:8}]}])\n Item fields for items[] when type:"effect":\n name (string, required) \u2014 Style name\n effects (array, required) \u2014 Array of Effect objects\n description (string, optional) \u2014 Style description\n\n ## grid \u2014 Grid/layout grid style\n Example: styles(method:"create", type:"grid", items:[{name:"Grid/Desktop 12", layoutGrids:[{pattern:"COLUMNS", alignment:"STRETCH", count:12, gutterSize:24, offset:80}]}])\n Item fields for items[] when type:"grid":\n name (string, required) \u2014 Style name\n layoutGrids (array, required) \u2014 Array of LayoutGrid objects. Conditional shapes: GRID requires sectionSize and does not use alignment/count/gutterSize/offset; ROWS/COLUMNS use alignment/count/gutterSize/offset, and sectionSize only for fixed alignments MIN/MAX/CENTER. For alignment:STRETCH, omit sectionSize.\n description (string, optional) \u2014 Style description\n\nResponse:\n { results: ({id} | {error})[] }\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// LayoutGrid is conditional: GridLayoutGrid {pattern:"GRID", sectionSize:number, visible?:boolean, color?:Color}; RowsColsLayoutGrid {pattern:"ROWS"|"COLUMNS", alignment?:"MIN"|"MAX"|"CENTER"|"STRETCH", gutterSize?:number, count?:number, offset?:number, sectionSize?:number, visible?:boolean, color?:Color}. For alignment:"STRETCH", omit sectionSize; Figma computes stretched row/column sizes. Use sectionSize only with fixed rows/columns (MIN/MAX/CENTER) or GRID.',
1250
+ "update": '# styles.update\nUpdate styles by ID or name\n\nExample: styles(method:"update", items:[{id:"Gradient/Primary", paints:[{type:"GRADIENT_LINEAR", gradientTransform:[[1,0,0],[0,1,0]], gradientStops:[{position:0,color:"#7D58ED"},{position:1,color:"#207CE5"}]}]}])\n\nParams:\n type (paint | text | effect | grid, optional) \u2014 Style type hint for strict validation (optional, auto-detected)\n items (PatchStyleItem[], required) \u2014 Array of {id, ...fields} to update\n id (string, required) \u2014 Style ID or name\n name (string, optional) \u2014 Rename the style\n description (string, optional) \u2014 Style description\n paints (Paint[], optional) \u2014 Replace PaintStyle.paints. Accepts only SOLID and GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND, using gradientTransform + gradientStops, opacity/blendMode, and gradientStops[].boundVariables.color. Mutually exclusive with color/colorVariableName. Do not pass IMAGE/VIDEO/PATTERN, CSS gradients, REST gradientHandlePositions, or top-level gradient boundVariables. Use imageUrl/images for image authoring on nodes; VIDEO/PATTERN authoring is not supported here. For examples call styles(method:"help", topic:"update").\n color (Color, optional) \u2014 New single-solid color shorthand (paint styles)\n colorVariableName (string, optional) \u2014 Bind to a COLOR variable by name using single-solid shorthand (paint styles)\n fontFamily (string, optional)\n fontStyle (string, optional)\n fontSize (number, optional)\n lineHeight (number | {value, unit: "PIXELS"|"PERCENT"|"AUTO"}, optional)\n letterSpacing (number | {value, unit: "PIXELS"|"PERCENT"}, optional)\n textCase (ORIGINAL | UPPER | LOWER | TITLE | SMALL_CAPS | SMALL_CAPS_FORCED, optional)\n textDecoration (NONE | UNDERLINE | STRIKETHROUGH, optional)\n paragraphIndent (number, optional) \u2014 Paragraph indent (px)\n paragraphSpacing (number, optional) \u2014 Paragraph spacing (px)\n leadingTrim (CAP_HEIGHT | NONE, optional)\n effects (array, optional) \u2014 Array of Effect objects\n layoutGrids (array, optional) \u2014 Array of LayoutGrid objects (grid styles). Conditional shapes: GRID requires sectionSize and does not use alignment/count/gutterSize/offset; ROWS/COLUMNS use alignment/count/gutterSize/offset, and sectionSize only for fixed alignments MIN/MAX/CENTER. For alignment:STRETCH, omit sectionSize.\n\nResponse:\n { results: ("ok" | {error} | object)[] }\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// LayoutGrid is conditional: GridLayoutGrid {pattern:"GRID", sectionSize:number, visible?:boolean, color?:Color}; RowsColsLayoutGrid {pattern:"ROWS"|"COLUMNS", alignment?:"MIN"|"MAX"|"CENTER"|"STRETCH", gutterSize?:number, count?:number, offset?:number, sectionSize?:number, visible?:boolean, color?:Color}. For alignment:"STRETCH", omit sectionSize; Figma computes stretched row/column sizes. Use sectionSize only with fixed rows/columns (MIN/MAX/CENTER) or GRID.',
1251
+ "delete": '# styles.delete\nDelete styles\n\nParams:\n id (string, optional) \u2014 Style ID or name\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, required) \u2014 Style ID or name\n\nResponse:\n { results: ("ok" | {error})[] }'
1021
1252
  }
1022
1253
  },
1023
1254
  "text": {
1024
- "summary": '# text\nCreate and manage text nodes.\n\nMethods:\n get Get serialized node data [read]\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n update Patch node properties [edit]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n create Create text nodes [create]\n set_content Replace text content on existing text nodes [edit]\n scan Scan all text nodes within a subtree [read]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// properties: escape hatch \u2014 set any Figma node property directly. Use only when no dedicated field exists.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}}\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.\n// Unknown keys produce a warning, preventing silent failures.\n// Text nodes display text content with typography styling. They inherit node methods (get, list, update, delete, clone, reparent).\n// textAutoResize: NONE (fixed box), WIDTH_AND_HEIGHT (grow both), HEIGHT (fixed width, auto height), TRUNCATE (fixed + ellipsis).\n// Prefer textStyleName for typography, fontColorVariableName/fontColorStyleName for color.\n// Aliases: fillColor \u2192 fontColor, fillVariableName \u2192 fontColorVariableName, fillStyleName \u2192 fontColorStyleName (consistent with frames API).\n// ---\n// Smart defaults inside auto-layout parent: layoutSizingHorizontal defaults to FILL, layoutSizingVertical to HUG, textAutoResize to HEIGHT.\n// Text fills parent width and wraps automatically. Override with explicit values if needed.\n// fontStyle vs fontWeight: fontStyle is a named variant like "Bold", "Italic", "SemiBold". When set, fontWeight is ignored.\n// Use fonts.list to find available fontFamily + fontStyle combinations.\n// scan: finds all text nodes in a subtree. path (when includePath:true) shows the layer hierarchy e.g. "Frame > Card > Label".\n// ScanResult (per-item): { nodeId, count, truncated, textNodes: [{ id, name, characters, fontSize, fontFamily, fontStyle, path?, depth?, absoluteX?, absoluteY?, width?, height? }] }\n\nUse text(method: "help", topic: "<method>") for method details.',
1255
+ "summary": '# text\nCreate and manage text nodes.\n\nMethods:\n get Get serialized node data [read]\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n update Patch node properties [edit]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n scale Proportionally rescale a node subtree using Figma\'s visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing. [edit]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n create Create text nodes [create]\n set_content Replace text content on existing text nodes [edit]\n scan Scan all text nodes within a subtree [read]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// clipsContent: clip children to the node bounds where supported (frames/components/instances). Set false for overflow-visible layouts.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // readback Paint[]; authoring supports SOLID + gradients via gradientTransform + gradientStops\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create. Paint[] authoring supports SOLID + gradients only; IMAGE/VIDEO/PATTERN are readback-only metadata.\n// Unknown keys produce a warning, preventing silent failures.\n// Text nodes display text content with typography styling. They inherit node methods (get, list, update, delete, clone, reparent).\n// textAutoResize: NONE (fixed box), WIDTH_AND_HEIGHT (grow both), HEIGHT (fixed width, auto height), TRUNCATE (fixed + ellipsis).\n// Prefer textStyleName for typography, fontColorVariableName/fontColorStyleName for color.\n// Aliases: fillColor \u2192 fontColor, fillVariableName \u2192 fontColorVariableName, fillStyleName \u2192 fontColorStyleName (consistent with frames API).\n// ---\n// Smart defaults inside auto-layout parent: layoutSizingHorizontal defaults to FILL, layoutSizingVertical to HUG, textAutoResize to HEIGHT.\n// Text fills parent width and wraps automatically. Override with explicit values if needed.\n// fontStyle vs fontWeight: fontStyle is a named variant like "Bold", "Italic", "SemiBold". When set, fontWeight is ignored.\n// Use fonts.list to find available fontFamily + fontStyle combinations.\n// scan: finds all text nodes in a subtree. path (when includePath:true) shows the layer hierarchy e.g. "Frame > Card > Label".\n// ScanResult (per-item): { nodeId, count, truncated, textNodes: [{ id, name, characters, fontSize, fontFamily, fontStyle, path?, depth?, absoluteX?, absoluteY?, width?, height? }] }\n\nUse text(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.\n// NodeStub: {id: string, name: string, type: string}',
1025
1256
  "methods": {
1026
- "get": '# text.get\nGet serialized node data\n\nParams:\n id (string, required) \u2014 Node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.',
1027
- "list": '# text.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
1257
+ "get": '# text.get\nGet serialized node data\n\nParams:\n id (string, required) \u2014 Node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.\n\nResponse:\n Serialized node tree. Shape depends on depth parameter.\n results (Node[], required) \u2014 Serialized node trees\n _truncated (boolean, optional) \u2014 True when node budget exceeded\n _notice (string, optional) \u2014 Human-readable truncation notice',
1258
+ "list": '# text.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n Paginated node search results (uses `results` not `items`)\n totalCount (number, required) \u2014 Total matching nodes\n returned (number, required) \u2014 Nodes in this page\n offset (number, optional)\n limit (number, optional)\n results (array, required) \u2014 Matching node stubs\n id (string, required)\n name (string, required)\n type (string, required)\n parentId (string, required)\n parentName (string, optional)\n bounds (object, optional)',
1028
1259
  "update": `# text.update
1029
1260
  Patch node properties
1030
1261
 
1031
1262
  Params:
1032
- items (PatchItem[], required) \u2014 Array of {id, ...properties} to patch
1033
- fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
1263
+ items (PatchItem[], required) \u2014 Array of {id, ...fields} to patch
1264
+ fills (Paint[], optional) \u2014 Fill Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] for transparent. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables; use imageUrl/images for image authoring. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set non-image fills.
1034
1265
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
1035
1266
  fillStyleName (string, optional) \u2014 Paint style name for fill
1036
- fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
1037
- strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
1267
+ fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/surface'
1268
+ strokes (Paint[], optional) \u2014 Stroke Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. [] to clear. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only. Primary way to set strokes.
1038
1269
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
1039
1270
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
1040
1271
  strokeVariableName (string, optional) \u2014 Color variable by name for stroke
@@ -1109,9 +1340,35 @@ Params:
1109
1340
  explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
1110
1341
  exportSettings (array, optional) \u2014 Export settings
1111
1342
  annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
1112
- properties (object, optional) \u2014 Direct Figma API props (escape hatch)`,
1113
- "delete": "# text.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)",
1114
- "clone": "# text.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
1343
+ clipsContent (boolean, optional) \u2014 Clip children to bounds where supported (frames/components/instances).
1344
+
1345
+ Response:
1346
+ { results: ("ok" | {error} | object)[] }
1347
+ // Shared types:
1348
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
1349
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
1350
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
1351
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
1352
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
1353
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
1354
+ // Effect: {type: "DROP_SHADOW"|"INNER_SHADOW"|"LAYER_BLUR"|"BACKGROUND_BLUR", radius: number, color?: {r,g,b,a} (0-1), offset?: {x, y}, spread?: number, visible?: boolean}
1355
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
1356
+ "delete": '# text.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
1357
+ "clone": "# text.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n\nResponse:\n { results: ({id} | {error})[] }",
1358
+ "scale": `# text.scale
1359
+ Proportionally rescale a node subtree using Figma's visual Scale tool behavior. This is for visual/artifact scaling, not responsive layout resizing.
1360
+
1361
+ Example: text(method:"scale", id:"1:23", factor:0.5)
1362
+
1363
+ Params:
1364
+ id (string, optional) \u2014 Node ID to scale
1365
+ factor (number, optional) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%. Scales children, text, strokes, effects, and layout geometry from the node's top-left. On auto-layout or HUG/FILL nodes, Figma may resolve responsive sizing to fixed width/height.
1366
+ items (array, optional) \u2014 Batch: [{id, factor}, ...]. Alternative to single-item params.
1367
+ id (string, required) \u2014 Node ID to scale
1368
+ factor (number, required) \u2014 Scale factor, >= 0.01. 0.5 = 50%, 2 = 200%.
1369
+
1370
+ Response:
1371
+ { results: ("ok" | {error})[] }`,
1115
1372
  "audit": `# text.audit
1116
1373
  Run lint on a node \u2014 returns severity-ranked findings
1117
1374
 
@@ -1121,12 +1378,17 @@ Params:
1121
1378
  maxDepth (number, optional) \u2014 Max tree depth (default: 10)
1122
1379
  maxFindings (number, optional) \u2014 Max findings (default: 50)
1123
1380
  minSeverity (error | unsafe | heuristic | style | verbose, optional) \u2014 Minimum severity to report (default: style). Set to 'verbose' to include AAA contrast and line-height checks.
1124
- skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
1125
- "reparent": "# text.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)",
1381
+ skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)
1382
+
1383
+ Response:
1384
+ nodeId (string, optional)
1385
+ nodeName (string, optional)
1386
+ categories (array, optional) \u2014 Sorted by severity (error > unsafe > heuristic > style)`,
1387
+ "reparent": '# text.reparent\nMove nodes into a new parent\n\nParams:\n items (array, required) \u2014 Array of {id, parentId, index?}\n id (string, required)\n parentId (string, required)\n index (number, optional)\n\nResponse:\n { results: ("ok" | {error})[] }',
1126
1388
  "create": `# text.create
1127
1389
  Create text nodes
1128
1390
 
1129
- Example: text(method:"create", items:[{text:"Hello", fontFamily:"Inter", fontSize:16, textStyleName:"body/medium"}])
1391
+ Example: text(method:"create", items:[{text:"Hello", textStyleName:"Body/Regular", fontColorVariableName:"text/primary"}])
1130
1392
 
1131
1393
  Params:
1132
1394
  items (TextItem[], required) \u2014 Array of text items to create
@@ -1144,7 +1406,7 @@ Params:
1144
1406
  letterSpacing (number | {value, unit: "PIXELS"|"PERCENT"}, optional)
1145
1407
  textCase (ORIGINAL | UPPER | LOWER | TITLE | SMALL_CAPS | SMALL_CAPS_FORCED, optional)
1146
1408
  textDecoration (NONE | UNDERLINE | STRIKETHROUGH, optional)
1147
- fills (array, optional) \u2014 Text color paints \u2014 e.g. [{type: 'SOLID', color: '#hex'}]. Same as node fills.
1409
+ fills (Paint[], optional) \u2014 Text Paint[] authoring \u2014 accepts only SOLID or GRADIENT_LINEAR/RADIAL/ANGULAR/DIAMOND with gradientTransform + gradientStops. Same as node fills. Do not use CSS gradients, REST gradientHandlePositions, IMAGE/VIDEO/PATTERN, or top-level gradient boundVariables. IMAGE/VIDEO/PATTERN may appear in readback metadata only.
1148
1410
  fontColor (Color, optional) \u2014 Shorthand \u2014 sets text color (auto-binds to matching variable/style)
1149
1411
  fontColorVariableName (string, optional) \u2014 Bind color variable by name e.g. 'text/primary'
1150
1412
  fontColorStyleName (string, optional) \u2014 Apply paint style \u2014 overrides fontColor
@@ -1158,20 +1420,56 @@ Params:
1158
1420
  componentPropertyName (string, optional) \u2014 Bind to a component TEXT property by name. Walks up ancestors to find the nearest component, or targets the component specified by componentId. For deeply nested text, consider using components(method:'create', type:'from_node') with exposeText:true instead \u2014 it auto-discovers and binds all text nodes.
1159
1421
  componentId (string, optional) \u2014 Target component ID for componentPropertyName binding. When omitted, walks up ancestors to find the nearest COMPONENT or COMPONENT_SET.
1160
1422
  annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
1161
- depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.`,
1162
- "set_content": "# text.set_content\nReplace text content on existing text nodes\n\nParams:\n items (array, required) \u2014 Array of {nodeId, text}\n nodeId (string, required) \u2014 Text node ID\n text (string, required) \u2014 New text content\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
1163
- "scan": "# text.scan\nScan all text nodes within a subtree\n\nParams:\n items ({ nodeId: string; limit?: number; includePath?: boolean; includeGeometry?: boolean }[], required) \u2014 Array of subtrees to scan"
1423
+ depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.
1424
+
1425
+ Response:
1426
+ { results: ({id} | {error})[] }
1427
+ // Shared types:
1428
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
1429
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
1430
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
1431
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
1432
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
1433
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
1434
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
1435
+ "set_content": '# text.set_content\nReplace text content on existing text nodes\n\nParams:\n items (array, required) \u2014 Array of {nodeId, text}\n nodeId (string, required) \u2014 Text node ID\n text (string, required) \u2014 New text content\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n\nResponse:\n { results: ("ok" | {error})[] }',
1436
+ "scan": '# text.scan\nScan all text nodes within a subtree\n\nParams:\n items ({ nodeId: string; limit?: number; includePath?: boolean; includeGeometry?: boolean }[], required) \u2014 Array of subtrees to scan\n\nResponse:\n { results: ("ok" | {error} | object)[] }'
1164
1437
  }
1165
1438
  },
1166
1439
  "variable_collections": {
1167
- "summary": '# variable_collections\nCRUD for variable collections \u2014 the document-level API for design tokens.\n\nMethods:\n list List variable collections [read]\n get Get collection with all variables and values (full document) [read]\n create Create a collection with modes and variables in one call [create]\n update Rename collections [edit]\n delete Delete collections [edit]\n add_mode Add a mode to a collection [create]\n rename_mode Rename a mode [edit]\n remove_mode Remove a mode from a collection [edit]\n\n// Variable collections group design tokens and define their modes (e.g. Light/Dark, Desktop/Mobile).\n// All ID params accept both IDs and display names.\n// ---\n// valuesByMode: values keyed by mode name, e.g. {"Light": "#FFF", "Dark": "#111"}.\n// Aliases: {type: "VARIABLE_ALIAS", name: "other/variable"}.\n// scopes: see variables endpoint for full list.\n// Deleting a collection deletes all variables inside it.\n// The default mode cannot be removed. Use add_mode/remove_mode for additional modes.\n\nUse variable_collections(method: "help", topic: "<method>") for method details.',
1440
+ "summary": '# variable_collections\nCRUD for variable collections \u2014 the document-level API for design tokens.\n\nMethods:\n list List variable collections [read]\n get Get collection with all variables and values (full document) [read]\n create Create a collection with modes and variables in one call [create]\n update Rename collections [edit]\n delete Delete collections [edit]\n add_mode Add a mode to a collection [create]\n rename_mode Rename a mode [edit]\n remove_mode Remove a mode from a collection [edit]\n\n// Variable collections group design tokens and define their modes (e.g. Light/Dark, Desktop/Mobile).\n// All ID params accept both IDs and display names.\n// ---\n// valuesByMode: values keyed by mode name, e.g. {"Light": "#FFF", "Dark": "#111"}.\n// Aliases in variable values use {type: "VARIABLE_ALIAS", name: "other/variable"}.\n// Paint[] VariableAlias uses {type:"VARIABLE_ALIAS", id:"<VariableID>"}; variable_collections.get includes each variable id. Prefer *VariableName helpers when available.\n// scopes: see variables endpoint for full list.\n// Deleting a collection deletes all variables inside it.\n// The default mode cannot be removed. Use add_mode/remove_mode for additional modes.\n\nUse variable_collections(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.',
1168
1441
  "methods": {
1169
- "list": '# variable_collections.list\nList variable collections\n\nParams:\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
1170
- "get": '# variable_collections.get\nGet collection with all variables and values (full document)\n\nParams:\n id (string, required) \u2014 Collection ID or name\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.',
1442
+ "list": '# variable_collections.list\nList variable collections\n\nParams:\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n totalCount (number, required)\n returned (number, optional)\n offset (number, optional)\n limit (number, optional)\n items (array, required)\n id (string, required)\n name (string, required)\n modes (string[], optional) \u2014 Mode names\n variableCount (number, optional) \u2014 Number of variables',
1443
+ "get": `# variable_collections.get
1444
+ Get collection with all variables and values (full document)
1445
+
1446
+ Params:
1447
+ id (string, required) \u2014 Collection ID or name
1448
+ fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.
1449
+
1450
+ Response:
1451
+ id (string, required)
1452
+ name (string, required)
1453
+ modes (string[], required) \u2014 Mode names (e.g. ['Light', 'Dark'])
1454
+ variables (array, required) \u2014 All variables in this collection
1455
+ id (string, required) \u2014 Figma VariableID. Use as VariableAlias.id in Paint[] when needed.
1456
+ name (string, required)
1457
+ type (string, required) \u2014 COLOR | FLOAT | STRING | BOOLEAN
1458
+ valuesByMode (object, required) \u2014 Values keyed by mode name
1459
+ scopes (string[], optional)
1460
+ description (string, optional)
1461
+ // Shared types:
1462
+ // Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}
1463
+ // VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.
1464
+ // Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)
1465
+ // BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"
1466
+ // ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}
1467
+ // GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.
1468
+ // Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.`,
1171
1469
  "create": `# variable_collections.create
1172
1470
  Create a collection with modes and variables in one call
1173
1471
 
1174
- Example: variable_collections(method:"create", items:[{name:"Tokens", modes:["Light","Dark"], variables:[{name:"bg/primary", type:"COLOR", valuesByMode:{"Light":"#FFF","Dark":"#111"}, scopes:["ALL_FILLS"]}, {name:"text/primary", type:"COLOR", valuesByMode:{"Light":"#111","Dark":"#F0F0F0"}, scopes:["TEXT_FILL"]}, {name:"space/16", type:"FLOAT", value:16, scopes:["GAP","WIDTH_HEIGHT"]}, {name:"radius/8", type:"FLOAT", value:8, scopes:["CORNER_RADIUS"]}]}])
1472
+ Example: variable_collections(method:"create", items:[{name:"Tokens", variables:[{name:"bg/canvas", type:"COLOR", value:"#F7F8FA", scopes:["ALL_FILLS"]}, {name:"bg/surface", type:"COLOR", value:"#FFFFFF", scopes:["ALL_FILLS"]}, {name:"bg/accent", type:"COLOR", value:"#2563EB", scopes:["ALL_FILLS"]}, {name:"bg/muted", type:"COLOR", value:"#E5E7EB", scopes:["ALL_FILLS"]}, {name:"text/primary", type:"COLOR", value:"#111827", scopes:["TEXT_FILL"]}, {name:"text/secondary", type:"COLOR", value:"#4B5563", scopes:["TEXT_FILL"]}, {name:"text/inverse", type:"COLOR", value:"#FFFFFF", scopes:["TEXT_FILL"]}, {name:"border/subtle", type:"COLOR", value:"#D1D5DB", scopes:["STROKE_COLOR"]}, {name:"icon/primary", type:"COLOR", value:{type:"VARIABLE_ALIAS", name:"text/primary"}, scopes:["ALL_FILLS","STROKE_COLOR"]}, {name:"status/success", type:"COLOR", value:"#16A34A", scopes:["ALL_FILLS"]}, {name:"space/8", type:"FLOAT", value:8, scopes:["GAP"]}, {name:"space/12", type:"FLOAT", value:12, scopes:["GAP"]}, {name:"space/16", type:"FLOAT", value:16, scopes:["GAP"]}, {name:"space/24", type:"FLOAT", value:24, scopes:["GAP"]}, {name:"radius/8", type:"FLOAT", value:8, scopes:["CORNER_RADIUS"]}, {name:"radius/12", type:"FLOAT", value:12, scopes:["CORNER_RADIUS"]}, {name:"radius/16", type:"FLOAT", value:16, scopes:["CORNER_RADIUS"]}, {name:"stroke/1", type:"FLOAT", value:1, scopes:["STROKE_FLOAT"]}]}])
1175
1473
 
1176
1474
  Params:
1177
1475
  items (array, required) \u2014 Array of collection documents
@@ -1183,22 +1481,25 @@ Params:
1183
1481
  value (variable_value, optional) \u2014 Sets all modes to this value. Use valuesByMode for per-mode control.
1184
1482
  valuesByMode (object, optional) \u2014 Values keyed by mode name (e.g. {"Light": "#FFF", "Dark": "#111"})
1185
1483
  description (string, optional)
1186
- scopes (string[], optional) \u2014 Restrict where variable can be applied (default: ALL_SCOPES)`,
1187
- "update": "# variable_collections.update\nRename collections\n\nParams:\n items (array, required) \u2014 Array of {id, name}\n id (string, required) \u2014 Collection ID or name\n name (string, required) \u2014 New name",
1188
- "delete": "# variable_collections.delete\nDelete collections\n\nParams:\n id (string, optional) \u2014 Collection ID or name\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, required)",
1189
- "add_mode": "# variable_collections.add_mode\nAdd a mode to a collection\n\nParams:\n items (array, required) \u2014 Array of {collectionId, name}\n collectionId (string, required) \u2014 Collection ID or name\n name (string, required) \u2014 Mode name",
1190
- "rename_mode": '# variable_collections.rename_mode\nRename a mode\n\nParams:\n items (array, required) \u2014 Array of {collectionId, modeId, name}\n collectionId (string, required) \u2014 Collection ID or name\n modeId (string, required) \u2014 Mode ID or name (e.g. "Dark")\n name (string, required) \u2014 New name',
1191
- "remove_mode": '# variable_collections.remove_mode\nRemove a mode from a collection\n\nParams:\n items (array, required) \u2014 Array of {collectionId, modeId}\n collectionId (string, required) \u2014 Collection ID or name\n modeId (string, required) \u2014 Mode ID or name (e.g. "Dark")'
1484
+ scopes (string[], optional) \u2014 Restrict where variable can be applied (default: ALL_SCOPES)
1485
+
1486
+ Response:
1487
+ { results: ({id} | {error})[] }`,
1488
+ "update": '# variable_collections.update\nRename collections\n\nParams:\n items (array, required) \u2014 Array of {id, name}\n id (string, required) \u2014 Collection ID or name\n name (string, required) \u2014 New name\n\nResponse:\n { results: ("ok" | {error} | object)[] }',
1489
+ "delete": '# variable_collections.delete\nDelete collections\n\nParams:\n id (string, optional) \u2014 Collection ID or name\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, required)\n\nResponse:\n { results: ("ok" | {error})[] }',
1490
+ "add_mode": "# variable_collections.add_mode\nAdd a mode to a collection\n\nParams:\n items (array, required) \u2014 Array of {collectionId, name}\n collectionId (string, required) \u2014 Collection ID or name\n name (string, required) \u2014 Mode name\n\nResponse:\n { results: ({id} | {error})[] }",
1491
+ "rename_mode": '# variable_collections.rename_mode\nRename a mode\n\nParams:\n items (array, required) \u2014 Array of {collectionId, modeId, name}\n collectionId (string, required) \u2014 Collection ID or name\n modeId (string, required) \u2014 Mode ID or name (e.g. "Dark")\n name (string, required) \u2014 New name\n\nResponse:\n { results: ("ok" | {error} | object)[] }',
1492
+ "remove_mode": '# variable_collections.remove_mode\nRemove a mode from a collection\n\nParams:\n items (array, required) \u2014 Array of {collectionId, modeId}\n collectionId (string, required) \u2014 Collection ID or name\n modeId (string, required) \u2014 Mode ID or name (e.g. "Dark")\n\nResponse:\n { results: ("ok" | {error})[] }'
1192
1493
  }
1193
1494
  },
1194
1495
  "variables": {
1195
- "summary": '# variables\nSearch and update design variables within a collection.\n\nMethods:\n list Search variables within a collection [read]\n get Get variable detail by name [read]\n create Create variables in a collection. Use valuesByMode for per-mode control, or value to set all modes at once. [create]\n update Update variable metadata and/or set values [edit]\n delete Delete variables [edit]\n\n// Search and update variables within a collection. collectionId is required on all methods.\n// Use variable_collections to create full token sets (collection + modes + variables in one call).\n// ---\n// query: prefix match first, then substring. "bg/" matches bg/canvas, bg/surface, etc.\n// valuesByMode: values keyed by mode name. On create, value sets all modes; on update, value sets the default mode only.\n// Aliases: {type: "VARIABLE_ALIAS", name: "other/variable"}.\n// scopes: ALL_SCOPES, TEXT_CONTENT, WIDTH_HEIGHT, GAP, CORNER_RADIUS, ALL_FILLS, FRAME_FILL, SHAPE_FILL,\n// TEXT_FILL, STROKE_COLOR, STROKE_FLOAT, EFFECT_FLOAT, EFFECT_COLOR, OPACITY, FONT_FAMILY, FONT_STYLE,\n// FONT_WEIGHT, FONT_SIZE, LINE_HEIGHT, LETTER_SPACING, PARAGRAPH_SPACING, PARAGRAPH_INDENT\n\nUse variables(method: "help", topic: "<method>") for method details.',
1496
+ "summary": '# variables\nSearch and update design variables within a collection.\n\nMethods:\n list Search variables within a collection [read]\n get Get variable detail by name [read]\n create Create variables in a collection. Use valuesByMode for per-mode control, or value to set all modes at once. [create]\n update Update variable metadata and/or set values [edit]\n delete Delete variables [edit]\n\n// Search and update variables within a collection. collectionId is required on all methods.\n// Use variable_collections to create full token sets (collection + modes + variables in one call).\n// ---\n// query: prefix match first, then substring. "bg/" matches bg/canvas, bg/surface, etc.\n// valuesByMode: values keyed by mode name. On create, value sets all modes; on update, value sets the default mode only.\n// Aliases in variable values use {type: "VARIABLE_ALIAS", name: "other/variable"}.\n// Paint[] VariableAlias uses {type:"VARIABLE_ALIAS", id:"<VariableID>"}; get IDs from variables.get/list or variable_collections.get. Prefer *VariableName helpers when available.\n// scopes: ALL_SCOPES, TEXT_CONTENT, WIDTH_HEIGHT, GAP, CORNER_RADIUS, ALL_FILLS, FRAME_FILL, SHAPE_FILL,\n// TEXT_FILL, STROKE_COLOR, STROKE_FLOAT, EFFECT_FLOAT, EFFECT_COLOR, OPACITY, FONT_FAMILY, FONT_STYLE,\n// FONT_WEIGHT, FONT_SIZE, LINE_HEIGHT, LETTER_SPACING, PARAGRAPH_SPACING, PARAGRAPH_INDENT\n\nUse variables(method: "help", topic: "<method>") for method details.\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.',
1196
1497
  "methods": {
1197
- "list": '# variables.list\nSearch variables within a collection\n\nExample: variables(method:"list", collectionId:"Colors", query:"bg/")\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n query (string, optional) \u2014 Search query \u2014 prefix match first, then substring fallback\n type (COLOR | FLOAT | STRING | BOOLEAN, optional) \u2014 Filter by variable type\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
1198
- "get": '# variables.get\nGet variable detail by name\n\nParams:\n name (string, required) \u2014 Variable name (unique within collection)\n collectionId (string, required) \u2014 Collection ID or name\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.',
1199
- "create": '# variables.create\nCreate variables in a collection. Use valuesByMode for per-mode control, or value to set all modes at once.\n\nExample: variables(method:"create", collectionId:"Colors", items:[{name:"bg/primary", type:"COLOR", valuesByMode:{"Light":"#FFF","Dark":"#111"}, scopes:["ALL_FILLS"]}])\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n items (VariableCreateItem[], required) \u2014 Array of variables to create\n name (string, required) \u2014 Variable name (must be unique within collection)\n type (COLOR | FLOAT | STRING | BOOLEAN, required) \u2014 Variable type\n value (variable_value, optional) \u2014 Sets all modes to this value. Use valuesByMode for per-mode control.\n valuesByMode (object, optional) \u2014 Values keyed by mode name (e.g. {"Light": "#FFF", "Dark": "#111"}). Takes precedence over value.\n description (string, optional) \u2014 Variable description\n scopes (string[], optional) \u2014 Restrict where variable can be applied (default: ALL_SCOPES)',
1200
- "update": '# variables.update\nUpdate variable metadata and/or set values\n\nExample: variables(method:"update", collectionId:"Colors", items:[{name:"bg/primary", valuesByMode:{"Light":"#FFF","Dark":"#222"}}])\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n items (VariableUpdateItem[], required) \u2014 Array of variable updates\n name (string, required) \u2014 Variable name\n rename (string, optional) \u2014 Rename the variable\n description (string, optional) \u2014 Set description\n scopes (string[], optional) \u2014 Update scopes\n value (variable_value, optional) \u2014 Shorthand \u2014 sets the default mode value. Use valuesByMode for multi-mode.\n valuesByMode (object, optional) \u2014 Values keyed by mode name. Takes precedence over value.',
1201
- "delete": "# variables.delete\nDelete variables\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n name (string, optional) \u2014 Variable name\n items (array, optional) \u2014 Batch: [{name}, ...]\n name (string, required)"
1498
+ "list": '# variables.list\nSearch variables within a collection\n\nExample: variables(method:"list", collectionId:"Tokens", query:"bg/")\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n query (string, optional) \u2014 Search query \u2014 prefix match first, then substring fallback\n type (COLOR | FLOAT | STRING | BOOLEAN, optional) \u2014 Filter by variable type\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)\n\nResponse:\n totalCount (number, required)\n returned (number, optional)\n offset (number, optional)\n limit (number, optional)\n items (array, required)\n id (string, required) \u2014 Figma VariableID. Use as VariableAlias.id in Paint[] when needed.\n name (string, required)\n type (string, optional) \u2014 COLOR | FLOAT | STRING | BOOLEAN\n valuesByMode (object, optional) \u2014 Values keyed by mode name\n scopes (string[], optional)\n description (string, optional)\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.',
1499
+ "get": '# variables.get\nGet variable detail by name\n\nParams:\n name (string, required) \u2014 Variable name (unique within collection)\n collectionId (string, required) \u2014 Collection ID or name\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n\nResponse:\n id (string, required) \u2014 Figma VariableID. Use as VariableAlias.id in Paint[] when needed.\n name (string, required)\n type (COLOR | FLOAT | STRING | BOOLEAN, required)\n collectionId (string, required) \u2014 Collection display name\n valuesByMode (Record<string, number | boolean | string | Color | {type: "VARIABLE_ALIAS", name: string}>, required) \u2014 Values keyed by mode name (e.g. "Light", "Dark")\n description (string, optional) \u2014 Variable description\n scopes (string[], optional) \u2014 Where this variable can be applied\n// Shared types:\n// Color: hex "#RGB"|"#RGBA"|"#RRGGBB"|"#RRGGBBAA" or {r: 0-1, g: 0-1, b: 0-1, a?: 0-1}\n// VariableAlias: {type: "VARIABLE_ALIAS", id: string}. The id must be a Figma VariableID; discover it via variables.get/list or variable_collections.get. Prefer colorVariableName/fillVariableName/strokeVariableName when available; Paint[] VariableAlias is mainly for precise Paint[] round-trips and gradient stop bindings.\n// Transform: [[number, number, number], [number, number, number]] (Figma Plugin API 2\xD73 matrix)\n// BlendMode: "PASS_THROUGH"|"NORMAL"|"DARKEN"|"MULTIPLY"|"LINEAR_BURN"|"COLOR_BURN"|"LIGHTEN"|"SCREEN"|"LINEAR_DODGE"|"COLOR_DODGE"|"OVERLAY"|"SOFT_LIGHT"|"HARD_LIGHT"|"DIFFERENCE"|"EXCLUSION"|"HUE"|"SATURATION"|"COLOR"|"LUMINOSITY"\n// ColorStop: {position: 0-1, color: Color, boundVariables?: {color?: VariableAlias}}\n// GradientPaint: {type: "GRADIENT_LINEAR"|"GRADIENT_RADIAL"|"GRADIENT_ANGULAR"|"GRADIENT_DIAMOND", gradientTransform: Transform, gradientStops: ColorStop[], visible?: boolean, opacity?: number, blendMode?: BlendMode}. Use gradientTransform + gradientStops (basic left-to-right: [[1,0,0],[0,1,0]]); do not use CSS gradients or REST gradientHandlePositions.\n// Paint: Paint[] authoring accepts only SOLID and GRADIENT_LINEAR/GRADIENT_RADIAL/GRADIENT_ANGULAR/GRADIENT_DIAMOND. SolidPaint: {type: "SOLID", color: Color, visible?: boolean, opacity?: number, blendMode?: BlendMode, boundVariables?: {color?: VariableAlias}}. GradientPaint authoring: {type: GRADIENT_*, gradientTransform: Transform, gradientStops: ColorStop[], visible?, opacity?, blendMode?}; bind variables on gradientStops[].boundVariables.color, not top-level gradient boundVariables. Do not pass IMAGE/VIDEO/PATTERN to create/update Paint[]; those may appear only in readback metadata from existing Figma content. Use imageUrl/images for image authoring. VIDEO/PATTERN authoring is not supported here. Do not use CSS gradients or REST gradientHandlePositions.',
1500
+ "create": '# variables.create\nCreate variables in a collection. Use valuesByMode for per-mode control, or value to set all modes at once.\n\nExample: variables(method:"create", collectionId:"Tokens", items:[{name:"bg/warning", type:"COLOR", value:"#F59E0B", scopes:["ALL_FILLS"]}])\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n items (VariableCreateItem[], required) \u2014 Array of variables to create\n name (string, required) \u2014 Variable name (must be unique within collection)\n type (COLOR | FLOAT | STRING | BOOLEAN, required) \u2014 Variable type\n value (variable_value, optional) \u2014 Sets all modes to this value. Use valuesByMode for per-mode control.\n valuesByMode (object, optional) \u2014 Values keyed by mode name (e.g. {"Light": "#FFF", "Dark": "#111"}). Takes precedence over value.\n description (string, optional) \u2014 Variable description\n scopes (string[], optional) \u2014 Restrict where variable can be applied (default: ALL_SCOPES)\n\nResponse:\n { results: ({id} | {error})[] }',
1501
+ "update": '# variables.update\nUpdate variable metadata and/or set values\n\nExample: variables(method:"update", collectionId:"Tokens", items:[{name:"bg/accent", value:"#1D4ED8"}])\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n items (VariableUpdateItem[], required) \u2014 Array of variable updates\n name (string, required) \u2014 Variable name\n rename (string, optional) \u2014 Rename the variable\n description (string, optional) \u2014 Set description\n scopes (string[], optional) \u2014 Update scopes\n value (variable_value, optional) \u2014 Shorthand \u2014 sets the default mode value. Use valuesByMode for multi-mode.\n valuesByMode (object, optional) \u2014 Values keyed by mode name. Takes precedence over value.\n\nResponse:\n { results: ("ok" | {error} | object)[] }',
1502
+ "delete": '# variables.delete\nDelete variables\n\nParams:\n collectionId (string, required) \u2014 Collection ID or name\n name (string, optional) \u2014 Variable name\n items (array, optional) \u2014 Batch: [{name}, ...]\n name (string, required)\n\nResponse:\n { results: ("ok" | {error})[] }'
1202
1503
  }
1203
1504
  },
1204
1505
  "version_history": {
@@ -1219,7 +1520,10 @@ Save a named version to the file's version history
1219
1520
 
1220
1521
  Params:
1221
1522
  title (string, required) \u2014 Version title (e.g., "Added hero sections with website copy")
1222
- description (string, optional) \u2014 Optional longer description of what changed`
1523
+ description (string, optional) \u2014 Optional longer description of what changed
1524
+
1525
+ Response:
1526
+ id (string, required) \u2014 Version ID returned by Figma`
1223
1527
  }
1224
1528
  }
1225
1529
  };