@ufira/vibma 1.0.0 → 1.1.0

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.
@@ -27,10 +27,15 @@ function mcpError(prefix, error) {
27
27
  // src/tools/generated/help.ts
28
28
  var helpDirectory = `# Available Endpoints
29
29
 
30
+ [node-inspection]
31
+ annotations Read and manage design annotations and annotation categories.
32
+ selection Read and set the current Figma selection.
33
+
30
34
  [design-system]
31
35
  components Create and manage reusable components and variant sets.
32
36
  fonts Search available fonts in Figma.
33
37
  instances Create and manage component instances.
38
+ library Discover and inspect published team library components and styles via Figma REST API.
34
39
  styles CRUD for local paint, text, effect, and grid styles.
35
40
  variable_collections CRUD for variable collections \u2014 the document-level API for design tokens.
36
41
  variables Search and update design variables within a collection.
@@ -44,6 +49,8 @@ var helpDirectory = `# Available Endpoints
44
49
 
45
50
  [creation]
46
51
  frames Create and manage frames, shapes, auto-layout containers, sections, and SVG nodes.
52
+ icons Search and create icons from 200k+ open-source icons via Iconify.
53
+ images Search stock photos from Pexels and apply image fills.
47
54
  text Create and manage text nodes.
48
55
 
49
56
  [quality]
@@ -52,19 +59,38 @@ var helpDirectory = `# Available Endpoints
52
59
  [interaction]
53
60
  prototyping Manage prototype interactions, reactions, and navigation flows.
54
61
 
55
- [node-inspection]
56
- selection Read and set the current Figma selection.
57
-
58
62
  Topics:
59
63
  missing_tools Why create or edit tools are missing and how to fix it
60
64
 
61
65
  Use help(topic: "<endpoint>") for endpoint details.
62
66
  Use help(topic: "<endpoint>.<method>") for method details.`;
63
67
  var helpEndpoints = {
68
+ "annotations": {
69
+ "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.',
70
+ "methods": {
71
+ "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)',
72
+ "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)',
73
+ "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',
74
+ "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)',
75
+ "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)',
76
+ "categories": '# annotations.categories\nList all annotation categories in the file\n\nExample: annotations(method:"categories")\n\nNo params.',
77
+ "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',
78
+ "update_category": `# annotations.update_category
79
+ Update an annotation category's label or color
80
+
81
+ Example: annotations(method:"update_category", id:"cat:123", label:"Layout", color:"teal")
82
+
83
+ Params:
84
+ id (string, required) \u2014 Category ID
85
+ label (string, optional) \u2014 New label
86
+ color (yellow | orange | red | pink | violet | blue | teal | green, optional) \u2014 New color`,
87
+ "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'
88
+ }
89
+ },
64
90
  "components": {
65
- "summary": '# components\nCreate and manage reusable components and variant sets.\n\nMethods:\n clone Duplicate nodes [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.',
91
+ "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.',
66
92
  "methods": {
67
- "clone": "# components.clone\nDuplicate nodes\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.",
93
+ "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.",
68
94
  "audit": `# components.audit
69
95
  Run lint on a node \u2014 returns severity-ranked findings
70
96
 
@@ -93,15 +119,17 @@ Discriminant: type (component | from_node | variant_set)
93
119
  width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
94
120
  height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
95
121
  rotation (number, optional) \u2014 Rotation in degrees (0-360)
96
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
97
122
  visible (boolean, optional) \u2014 Show/hide (default true)
98
123
  locked (boolean, optional) \u2014 Lock/unlock (default false)
124
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
99
125
  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)
100
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
126
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
101
127
  fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
102
128
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
103
129
  fillStyleName (string, optional) \u2014 Paint style name for fill
104
130
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
131
+ 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.
132
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
105
133
  strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
106
134
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
107
135
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
@@ -112,13 +140,11 @@ Discriminant: type (component | from_node | variant_set)
112
140
  strokeLeftWeight (string, optional)
113
141
  strokeRightWeight (string, optional)
114
142
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
115
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
116
143
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
117
144
  topLeftRadius (string, optional)
118
145
  topRightRadius (string, optional)
119
146
  bottomRightRadius (string, optional)
120
147
  bottomLeftRadius (string, optional)
121
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
122
148
  layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
123
149
  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.
124
150
  padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
@@ -128,15 +154,18 @@ Discriminant: type (component | from_node | variant_set)
128
154
  paddingLeft (string, optional)
129
155
  primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
130
156
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
131
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
132
- layoutSizingVertical (FIXED | HUG | FILL, optional)
133
157
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
134
158
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
159
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
160
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
161
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
162
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
163
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
135
164
  minWidth (number, optional) \u2014 Min width for responsive auto-layout
136
165
  maxWidth (number, optional) \u2014 Max width for responsive auto-layout
137
166
  minHeight (number, optional) \u2014 Min height for responsive auto-layout
138
167
  maxHeight (number, optional) \u2014 Max height for responsive auto-layout
139
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
168
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
140
169
  description (string, optional) \u2014 Component description (shown in Figma's component panel)
141
170
  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"}]}]
142
171
 
@@ -159,15 +188,17 @@ Discriminant: type (component | from_node | variant_set)
159
188
  width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
160
189
  height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
161
190
  rotation (number, optional) \u2014 Rotation in degrees (0-360)
162
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
163
191
  visible (boolean, optional) \u2014 Show/hide (default true)
164
192
  locked (boolean, optional) \u2014 Lock/unlock (default false)
193
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
165
194
  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)
166
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
195
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
167
196
  fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
168
197
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
169
198
  fillStyleName (string, optional) \u2014 Paint style name for fill
170
199
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
200
+ 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.
201
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
171
202
  strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
172
203
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
173
204
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
@@ -178,13 +209,11 @@ Discriminant: type (component | from_node | variant_set)
178
209
  strokeLeftWeight (string, optional)
179
210
  strokeRightWeight (string, optional)
180
211
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
181
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
182
212
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
183
213
  topLeftRadius (string, optional)
184
214
  topRightRadius (string, optional)
185
215
  bottomRightRadius (string, optional)
186
216
  bottomLeftRadius (string, optional)
187
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
188
217
  layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
189
218
  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.
190
219
  padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
@@ -194,15 +223,18 @@ Discriminant: type (component | from_node | variant_set)
194
223
  paddingLeft (string, optional)
195
224
  primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
196
225
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
197
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
198
- layoutSizingVertical (FIXED | HUG | FILL, optional)
199
226
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
200
227
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
228
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
229
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
230
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
231
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
232
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
201
233
  minWidth (number, optional) \u2014 Min width for responsive auto-layout
202
234
  maxWidth (number, optional) \u2014 Max width for responsive auto-layout
203
235
  minHeight (number, optional) \u2014 Min height for responsive auto-layout
204
236
  maxHeight (number, optional) \u2014 Max height for responsive auto-layout
205
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
237
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
206
238
  componentIds (string[], optional) \u2014 Existing component IDs to combine (min 2). Alternative to children.
207
239
  variantPropertyName (string, optional) \u2014 Rename the auto-generated variant property (default: 'Property 1')
208
240
  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.`,
@@ -237,7 +269,7 @@ Discriminant: type (component | from_node | variant_set)
237
269
  }
238
270
  },
239
271
  "frames": {
240
- "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 [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// 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.',
272
+ "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.',
241
273
  "methods": {
242
274
  "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.',
243
275
  "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)',
@@ -260,15 +292,14 @@ Params:
260
292
  strokeLeftWeight (string, optional)
261
293
  strokeRightWeight (string, optional)
262
294
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
263
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
264
295
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
265
296
  topLeftRadius (string, optional)
266
297
  topRightRadius (string, optional)
267
298
  bottomRightRadius (string, optional)
268
299
  bottomLeftRadius (string, optional)
269
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
270
300
  visible (boolean, optional) \u2014 Show/hide (default true)
271
301
  locked (boolean, optional) \u2014 Lock/unlock (default false)
302
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
272
303
  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)
273
304
  effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
274
305
  layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: NONE)
@@ -282,6 +313,7 @@ Params:
282
313
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
283
314
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
284
315
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
316
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
285
317
  layoutSizingHorizontal (FIXED | HUG | FILL, optional)
286
318
  layoutSizingVertical (FIXED | HUG | FILL, optional)
287
319
  layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
@@ -313,6 +345,8 @@ Params:
313
345
  width (number, optional)
314
346
  height (number, optional)
315
347
  clearFill (boolean, optional) \u2014 Remove all fills
348
+ 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.
349
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
316
350
  effects (array, optional) \u2014 Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR)
317
351
  overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
318
352
  constraints (object, optional)
@@ -322,9 +356,10 @@ Params:
322
356
  variableId (string, optional)
323
357
  explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
324
358
  exportSettings (array, optional) \u2014 Export settings
359
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
325
360
  properties (object, optional) \u2014 Direct Figma API props (escape hatch)`,
326
361
  "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)",
327
- "clone": "# frames.clone\nDuplicate nodes\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.",
362
+ "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.",
328
363
  "audit": `# frames.audit
329
364
  Run lint on a node \u2014 returns severity-ranked findings
330
365
 
@@ -351,15 +386,17 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
351
386
  width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
352
387
  height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
353
388
  rotation (number, optional) \u2014 Rotation in degrees (0-360)
354
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
355
389
  visible (boolean, optional) \u2014 Show/hide (default true)
356
390
  locked (boolean, optional) \u2014 Lock/unlock (default false)
391
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
357
392
  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)
358
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
393
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
359
394
  fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
360
395
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
361
396
  fillStyleName (string, optional) \u2014 Paint style name for fill
362
397
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
398
+ 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.
399
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
363
400
  strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
364
401
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
365
402
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
@@ -370,13 +407,11 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
370
407
  strokeLeftWeight (string, optional)
371
408
  strokeRightWeight (string, optional)
372
409
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
373
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
374
410
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
375
411
  topLeftRadius (string, optional)
376
412
  topRightRadius (string, optional)
377
413
  bottomRightRadius (string, optional)
378
414
  bottomLeftRadius (string, optional)
379
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
380
415
  layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
381
416
  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.
382
417
  padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
@@ -386,15 +421,18 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
386
421
  paddingLeft (string, optional)
387
422
  primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
388
423
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
389
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
390
- layoutSizingVertical (FIXED | HUG | FILL, optional)
391
424
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
392
425
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
426
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
427
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
428
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
429
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
430
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
393
431
  minWidth (number, optional) \u2014 Min width for responsive auto-layout
394
432
  maxWidth (number, optional) \u2014 Max width for responsive auto-layout
395
433
  minHeight (number, optional) \u2014 Min height for responsive auto-layout
396
434
  maxHeight (number, optional) \u2014 Max height for responsive auto-layout
397
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
435
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
398
436
  clipsContent (boolean, optional)
399
437
  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.
400
438
 
@@ -407,15 +445,17 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
407
445
  width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
408
446
  height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
409
447
  rotation (number, optional) \u2014 Rotation in degrees (0-360)
410
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
411
448
  visible (boolean, optional) \u2014 Show/hide (default true)
412
449
  locked (boolean, optional) \u2014 Lock/unlock (default false)
450
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
413
451
  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)
414
- layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
452
+ effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
415
453
  fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
416
454
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
417
455
  fillStyleName (string, optional) \u2014 Paint style name for fill
418
456
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
457
+ 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.
458
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
419
459
  strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
420
460
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
421
461
  strokeStyleName (string, optional) \u2014 Paint style name for stroke
@@ -426,13 +466,11 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
426
466
  strokeLeftWeight (string, optional)
427
467
  strokeRightWeight (string, optional)
428
468
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
429
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
430
469
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
431
470
  topLeftRadius (string, optional)
432
471
  topRightRadius (string, optional)
433
472
  bottomRightRadius (string, optional)
434
473
  bottomLeftRadius (string, optional)
435
- effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
436
474
  layoutMode (HORIZONTAL | VERTICAL, required) \u2014 Primary axis direction
437
475
  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.
438
476
  padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
@@ -442,15 +480,18 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
442
480
  paddingLeft (string, optional)
443
481
  primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
444
482
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
445
- layoutSizingHorizontal (FIXED | HUG | FILL, optional)
446
- layoutSizingVertical (FIXED | HUG | FILL, optional)
447
483
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
448
484
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
485
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
486
+ overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
487
+ layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
488
+ layoutSizingHorizontal (FIXED | HUG | FILL, optional)
489
+ layoutSizingVertical (FIXED | HUG | FILL, optional)
449
490
  minWidth (number, optional) \u2014 Min width for responsive auto-layout
450
491
  maxWidth (number, optional) \u2014 Max width for responsive auto-layout
451
492
  minHeight (number, optional) \u2014 Min height for responsive auto-layout
452
493
  maxHeight (number, optional) \u2014 Max height for responsive auto-layout
453
- overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
494
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
454
495
  clipsContent (boolean, optional)
455
496
  nodeIds (string[], optional) \u2014 Existing node IDs to wrap into auto-layout
456
497
  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.
@@ -467,6 +508,8 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
467
508
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
468
509
  fillStyleName (string, optional) \u2014 Paint style name for fill
469
510
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
511
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
512
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
470
513
 
471
514
  ## rectangle \u2014 Rectangle shape node
472
515
  name (string, optional) \u2014 Layer name (default: 'Rectangle')
@@ -479,6 +522,8 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
479
522
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
480
523
  fillStyleName (string, optional) \u2014 Paint style name for fill
481
524
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
525
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
526
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
482
527
  strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
483
528
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
484
529
  strokeVariableName (string, optional) \u2014 Color variable by name for stroke
@@ -491,6 +536,7 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
491
536
  opacity (string, optional)
492
537
  layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
493
538
  layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
539
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
494
540
 
495
541
  ## ellipse \u2014 Ellipse/circle shape node
496
542
  name (string, optional) \u2014 Layer name (default: 'Ellipse')
@@ -503,6 +549,8 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
503
549
  fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
504
550
  fillStyleName (string, optional) \u2014 Paint style name for fill
505
551
  fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
552
+ imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
553
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
506
554
  strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
507
555
  strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
508
556
  strokeVariableName (string, optional) \u2014 Color variable by name for stroke
@@ -510,6 +558,7 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
510
558
  opacity (string, optional)
511
559
  layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
512
560
  layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
561
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
513
562
 
514
563
  ## line \u2014 Line shape node
515
564
  name (string, optional) \u2014 Layer name (default: 'Line')
@@ -524,6 +573,7 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
524
573
  strokeWeight (string, optional) \u2014 Line thickness (default: 1)
525
574
  opacity (string, optional)
526
575
  layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent (defaults to FILL in vertical auto-layout)
576
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
527
577
 
528
578
  ## group \u2014 Group existing nodes together
529
579
  nodeIds (string[], required) \u2014 Node IDs to group (min 1)
@@ -537,25 +587,65 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
537
587
  parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
538
588
 
539
589
  ## svg \u2014 Create node from SVG markup
590
+ fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
591
+ fillVariableName (string, optional) \u2014 Color variable by name for vector fills
592
+ strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
593
+ strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes
540
594
  svg (string, required) \u2014 SVG markup string
541
595
  name (string, optional) \u2014 Layer name (default: 'SVG')
542
596
  parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
543
597
  x (number, optional) \u2014 X position (default: 0)
544
- y (number, optional) \u2014 Y position (default: 0)
545
- fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
546
- fillVariableName (string, optional) \u2014 Color variable by name for vector fills
547
- strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
548
- strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes`,
598
+ y (number, optional) \u2014 Y position (default: 0)`,
549
599
  "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',
550
600
  "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)"
551
601
  }
552
602
  },
603
+ "icons": {
604
+ "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.',
605
+ "methods": {
606
+ "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)',
607
+ "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)',
608
+ "create": `# icons.create
609
+ Create an icon node in Figma from an Iconify icon name
610
+
611
+ Example: icons(method:"create", icon:"lucide:home", size:24, colorVariableName:"text/primary", parentId:"1:2")
612
+
613
+ Params:
614
+ icon (string, required) \u2014 Icon name \u2014 "prefix:name" e.g. "lucide:home", "mdi:account"
615
+ size (number, optional) \u2014 Icon size in px (default 24, square)
616
+ name (string, optional) \u2014 Layer name (default: icon name)
617
+ parentId (string, optional) \u2014 Parent node ID. Omit for current page root.
618
+ x (number, optional) \u2014 X position (default: 0)
619
+ y (number, optional) \u2014 Y position (default: 0)
620
+ colorVariableName (string, optional) \u2014 Color variable for the icon \u2014 auto-detects fill vs stroke (e.g. 'text/primary')
621
+ colorStyleName (string, optional) \u2014 Paint style for the icon \u2014 auto-detects fill vs stroke (e.g. 'Icon/Primary')`
622
+ }
623
+ },
624
+ "images": {
625
+ "summary": '# images\nSearch stock photos from Pexels and apply image fills.\n\nMethods:\n search Search photos by keyword via Pexels API [read]\n preview Preview a photo by ID \u2014 returns the image so you can see it before placing [read]\n\n// Workflow: search \u2192 preview \u2192 place.\n// Search returns slim photo objects: { id, alt, avg_color, width, height }.\n// Preview returns the actual image so you can visually confirm before placing.\n// To place: pass imageUrl:"pexel:<id>" to frames.create or frames.update.\n// Attribution (photographer credit) is applied automatically as node description.\n// User-provided image URLs also work \u2014 any public image URL can be used as imageUrl on frames.\n// Powered by Pexels (pexels.com) \u2014 free stock photos. Requires PEXELS_API_KEY env var.\n\nUse images(method: "help", topic: "<method>") for method details.',
626
+ "methods": {
627
+ "search": `# images.search
628
+ Search photos by keyword via Pexels API
629
+
630
+ Example: images(method:"search", query:"sunset beach", orientation:"landscape", per_page:5)
631
+
632
+ Params:
633
+ query (string, required) \u2014 Search keyword (e.g. "sunset", "office", "nature")
634
+ orientation (landscape | portrait | square, optional) \u2014 Filter by photo orientation
635
+ size (large | medium | small, optional) \u2014 Minimum photo size
636
+ 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
637
+ locale (string, optional) \u2014 Locale for search (e.g. 'en-US', 'ja-JP'). Default: en-US
638
+ page (number, optional) \u2014 Page number for pagination (default: 1)
639
+ per_page (number, optional) \u2014 Results per page (default: 15, max: 80)`,
640
+ "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'
641
+ }
642
+ },
553
643
  "instances": {
554
- "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 [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: components.list \u2192 instances.create with componentId + properties (one call). No separate update needed for text/boolean overrides.\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.',
644
+ "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.',
555
645
  "methods": {
556
646
  "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)',
557
647
  "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)",
558
- "clone": "# instances.clone\nDuplicate nodes\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.",
648
+ "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.",
559
649
  "audit": `# instances.audit
560
650
  Run lint on a node \u2014 returns severity-ranked findings
561
651
 
@@ -571,13 +661,13 @@ Params:
571
661
  "create": `# instances.create
572
662
  Create component instances
573
663
 
574
- Example: instances(method:"create", items:[{componentId:"1:23", variantProperties:{"Size":"Large"}, properties:{"Label":"Click me"}, parentId:"2:45", layoutSizingHorizontal:"FILL"}])
664
+ 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
575
665
 
576
666
  Params:
577
667
  items (InstanceCreateItem[], required) \u2014 Array of {componentId, variantProperties?, x?, y?, parentId?, layoutSizingHorizontal?, ...}
578
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
579
668
  visible (boolean, optional) \u2014 Show/hide (default true)
580
669
  locked (boolean, optional) \u2014 Lock/unlock (default false)
670
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
581
671
  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)
582
672
  effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
583
673
  layoutSizingHorizontal (FIXED | HUG | FILL, optional)
@@ -587,7 +677,9 @@ Params:
587
677
  maxWidth (number, optional) \u2014 Max width for responsive auto-layout
588
678
  minHeight (number, optional) \u2014 Min height for responsive auto-layout
589
679
  maxHeight (number, optional) \u2014 Max height for responsive auto-layout
590
- componentId (string, required) \u2014 Component or component set ID
680
+ componentId (string, optional) \u2014 Local component or component set ID. Pass this OR componentKey.
681
+ componentKey (string, optional) \u2014 Published library component key \u2014 imports from a team library via importComponentByKeyAsync. Discover keys via library(method:"components", ...); the library tool auto-resolves names \u2192 keys so you normally pass componentName instead.
682
+ componentName (string, optional) \u2014 Name of a component previously discovered via the library tool. Resolved to a componentKey MCP-side \u2014 the agent never handles the raw key. Preferred over componentKey for context hygiene.
591
683
  sizing (contextual, optional) \u2014 "contextual": infer FILL/HUG from parent layout (e.g. FILL horizontally in a VERTICAL auto-layout parent). Omit to inherit sizing from the component definition.
592
684
  variantProperties (object, optional) \u2014 Pick variant e.g. {"Style":"Secondary"}
593
685
  properties (object, optional) \u2014 Set component properties inline e.g. {"Label":"Click me", "ShowIcon":true}. Same as instances.update properties.
@@ -596,6 +688,7 @@ Params:
596
688
  y (number, optional)
597
689
  width (number, optional) \u2014 Override width (resize)
598
690
  height (number, optional) \u2014 Override height (resize)
691
+ 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.
599
692
  parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
600
693
  depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.`,
601
694
  "update": `# instances.update
@@ -619,15 +712,14 @@ Params:
619
712
  strokeLeftWeight (string, optional)
620
713
  strokeRightWeight (string, optional)
621
714
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
622
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
623
715
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
624
716
  topLeftRadius (string, optional)
625
717
  topRightRadius (string, optional)
626
718
  bottomRightRadius (string, optional)
627
719
  bottomLeftRadius (string, optional)
628
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
629
720
  visible (boolean, optional) \u2014 Show/hide (default true)
630
721
  locked (boolean, optional) \u2014 Lock/unlock (default false)
722
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
631
723
  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)
632
724
  effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
633
725
  layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: NONE)
@@ -641,6 +733,7 @@ Params:
641
733
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
642
734
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
643
735
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
736
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
644
737
  layoutSizingHorizontal (FIXED | HUG | FILL, optional)
645
738
  layoutSizingVertical (FIXED | HUG | FILL, optional)
646
739
  layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
@@ -687,6 +780,67 @@ Params:
687
780
  "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"
688
781
  }
689
782
  },
783
+ "library": {
784
+ "summary": `# library
785
+ Discover and inspect published team library components and styles via Figma REST API.
786
+
787
+ Methods:
788
+ list List all published components, sets, and styles. Minimal shapes, no pagination. Populates the MCP name\u2192key registry. [read]
789
+ get 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. [read]
790
+
791
+ // Discover components and styles published to team libraries \u2014 external files not open in Figma.
792
+ // Requires FIGMA_API_TOKEN env var (Personal Access Token with library_content:read scope).
793
+ // Accepts a file URL/key, a team URL/ID, or falls back to the FIGMA_TEAM_ID env var if neither is passed.
794
+ //
795
+ // Two-step flow (discovery \u2192 use):
796
+ // 1. list \u2192 populates the MCP name\u2192key registry (one-shot, no pagination, no side effects in Figma)
797
+ // 2. get \u2192 rich details for any number of queries: componentPropertyDefinitions, variant options, defaults, usage hint
798
+ // 3. use \u2192 instances(method:"create", items:[{componentName:"..."}]) or frames/text with fillStyleName/textStyleName
799
+ //
800
+ // list returns { libraries: [{ name, sections: [{ name, components, componentSets, styles }] }] }.
801
+ // Libraries are grouped by source Figma file, then by section (containing frame) \u2014 mirroring Figma's Libraries browser.
802
+ // Use the library and section names to identify the right component when multiple libraries expose overlapping names.
803
+ //
804
+ // get returns the same nested hierarchy as list, but each leaf is a full detail object (properties, variant options,
805
+ // defaults, copy-pasteable usage hint) instead of a bare name. Pass library and/or section params to narrow results
806
+ // when names collide \u2014 e.g. library(method:"get", query:"Item", library:"macOS", section:"Sidebars").
807
+ //
808
+ // No import step needed. Every *Name referenced in a later tool call (componentName, fillStyleName,
809
+ // textStyleName, effectStyleName) is auto-resolved from the registry and imported on demand via
810
+ // figma.importComponentByKeyAsync / importStyleByKeyAsync. Local styles always take precedence \u2014
811
+ // library fallback only kicks in when no local style with that exact name exists.
812
+ //
813
+ // The raw 40-char component/style keys NEVER enter agent context \u2014 the MCP holds them internally.
814
+ //
815
+ // list must be called before get / before any name reference in other tools \u2014 the registry is initially empty.
816
+ // Results are cached for 5 minutes.
817
+ //
818
+ // Name collisions across files: first-seen wins; subsequent entries with the same name are re-keyed with
819
+ // " (in <frame>)" suffix in the registry so you can still address them.
820
+
821
+ Use library(method: "help", topic: "<method>") for method details.`,
822
+ "methods": {
823
+ "list": `# library.list
824
+ List all published components, sets, and styles. Minimal shapes, no pagination. Populates the MCP name\u2192key registry.
825
+
826
+ Example: library(method:"list") // uses FIGMA_TEAM_ID env var; or pass file/team explicitly
827
+
828
+ Params:
829
+ file (string, optional) \u2014 File URL or file key \u2014 e.g. 'https://www.figma.com/design/abc123/MyDS' or 'abc123'
830
+ team (string, optional) \u2014 Team URL or team ID. Falls back to FIGMA_TEAM_ID env var if omitted.`,
831
+ "get": `# library.get
832
+ 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.
833
+
834
+ Example: library(method:"get", query:["item","header"], library:"macOS", section:"Sidebars") // batch query scoped to a specific library and section
835
+
836
+ Params:
837
+ query (string[], required) \u2014 One or more substring queries (case-insensitive, matched against name OR description). Pass a single string or an array. Matches from multiple queries are merged and deduped by registered name before details are fetched.
838
+ 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.
839
+ 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.
840
+ file (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.
841
+ team (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.`
842
+ }
843
+ },
690
844
  "lint": {
691
845
  "summary": `# lint
692
846
  Run design quality and accessibility checks.
@@ -745,7 +899,18 @@ Methods:
745
899
 
746
900
  Use lint(method: "help", topic: "<method>") for method details.`,
747
901
  "methods": {
748
- "check": '# lint.check\nRun design linter on a node tree\n\nExample: lint(method:"check", nodeId:"0:1", rules:["wcag","hardcoded-color"])\n\nParams:\n nodeId (string, optional) \u2014 Node ID to lint. If omitted: 1 selected node \u2192 lints that node, 2+ selected \u2192 lints entire page (not the selection), 0 selected \u2192 error. Always pass nodeId explicitly for reliable targeting.\n rules (string[], optional) \u2014 Rules to run. Default: ["all"]. Categories: "component", "composition", "token", "naming", "wcag"/"accessibility". Or specific rule names.\n maxDepth (number, optional) \u2014 Max tree depth (default: 10)\n maxFindings (number, optional) \u2014 Max findings (default: 50)',
902
+ "check": `# lint.check
903
+ Run design linter on a node tree
904
+
905
+ Example: lint(method:"check", nodeId:"0:1", rules:["wcag","hardcoded-color"])
906
+
907
+ Params:
908
+ nodeId (string, optional) \u2014 Node ID to lint. If omitted: 1 selected node \u2192 lints that node, 2+ selected \u2192 lints entire page (not the selection), 0 selected \u2192 error. Always pass nodeId explicitly for reliable targeting.
909
+ rules (string[], optional) \u2014 Rules to run. Default: ["all"]. Categories: "component", "composition", "token", "naming", "wcag"/"accessibility". Or specific rule names.
910
+ maxDepth (number, optional) \u2014 Max tree depth (default: 10)
911
+ maxFindings (number, optional) \u2014 Max findings (default: 50)
912
+ 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.
913
+ skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
749
914
  "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"
750
915
  }
751
916
  },
@@ -776,7 +941,7 @@ Use lint(method: "help", topic: "<method>") for method details.`,
776
941
  }
777
942
  },
778
943
  "text": {
779
- "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 [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.',
944
+ "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.',
780
945
  "methods": {
781
946
  "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.',
782
947
  "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)',
@@ -799,15 +964,14 @@ Params:
799
964
  strokeLeftWeight (string, optional)
800
965
  strokeRightWeight (string, optional)
801
966
  strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
802
- strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
803
967
  cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
804
968
  topLeftRadius (string, optional)
805
969
  topRightRadius (string, optional)
806
970
  bottomRightRadius (string, optional)
807
971
  bottomLeftRadius (string, optional)
808
- opacity (string, optional) \u2014 Opacity (0-1) or variable name
809
972
  visible (boolean, optional) \u2014 Show/hide (default true)
810
973
  locked (boolean, optional) \u2014 Lock/unlock (default false)
974
+ opacity (string, optional) \u2014 Opacity (0-1) or variable name
811
975
  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)
812
976
  effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
813
977
  layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: NONE)
@@ -821,6 +985,7 @@ Params:
821
985
  counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
822
986
  itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
823
987
  counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
988
+ strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
824
989
  layoutSizingHorizontal (FIXED | HUG | FILL, optional)
825
990
  layoutSizingVertical (FIXED | HUG | FILL, optional)
826
991
  layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
@@ -852,6 +1017,8 @@ Params:
852
1017
  width (number, optional)
853
1018
  height (number, optional)
854
1019
  clearFill (boolean, optional) \u2014 Remove all fills
1020
+ 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.
1021
+ imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
855
1022
  effects (array, optional) \u2014 Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR)
856
1023
  overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
857
1024
  constraints (object, optional)
@@ -861,9 +1028,10 @@ Params:
861
1028
  variableId (string, optional)
862
1029
  explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
863
1030
  exportSettings (array, optional) \u2014 Export settings
1031
+ annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
864
1032
  properties (object, optional) \u2014 Direct Figma API props (escape hatch)`,
865
1033
  "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)",
866
- "clone": "# text.clone\nDuplicate nodes\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.",
1034
+ "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.",
867
1035
  "audit": `# text.audit
868
1036
  Run lint on a node \u2014 returns severity-ranked findings
869
1037
 
@@ -909,6 +1077,7 @@ Params:
909
1077
  textAutoResize (NONE | WIDTH_AND_HEIGHT | HEIGHT | TRUNCATE, optional) \u2014 NONE (fixed box), WIDTH_AND_HEIGHT (grow both), HEIGHT (fixed width, auto height), TRUNCATE (fixed + ellipsis)
910
1078
  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.
911
1079
  componentId (string, optional) \u2014 Target component ID for componentPropertyName binding. When omitted, walks up ancestors to find the nearest COMPONENT or COMPONENT_SET.
1080
+ annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
912
1081
  depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.`,
913
1082
  "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.",
914
1083
  "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"
@@ -1032,6 +1201,7 @@ function registerTools(server, sendCommand, caps, tools) {
1032
1201
  return { content: [{ type: "text", text }] };
1033
1202
  }
1034
1203
  if (tool.validate) tool.validate(params);
1204
+ if (tool.preProcess) await tool.preProcess(params);
1035
1205
  const command = resolveCommand(tool, params);
1036
1206
  params._caps = caps;
1037
1207
  const result = await sendCommand(command, params, timeout);