@ufira/vibma 1.0.0 → 1.1.1
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.
- package/README.md +48 -18
- package/dist/mcp.cjs +4812 -321
- package/dist/mcp.js +4838 -319
- package/dist/tools/generated/guards.cjs +72 -3
- package/dist/tools/generated/guards.d.cts +19 -1
- package/dist/tools/generated/guards.d.ts +19 -1
- package/dist/tools/generated/guards.js +63 -3
- package/dist/tools/registry.cjs +224 -54
- package/dist/tools/registry.js +224 -54
- package/dist/tools/types.d.cts +2 -0
- package/dist/tools/types.d.ts +2 -0
- package/dist/utils/coercion.cjs +18 -2
- package/dist/utils/coercion.d.cts +9 -1
- package/dist/utils/coercion.d.ts +9 -1
- package/dist/utils/coercion.js +16 -1
- package/package.json +1 -1
package/dist/tools/registry.cjs
CHANGED
|
@@ -50,10 +50,15 @@ function mcpError(prefix, error) {
|
|
|
50
50
|
// src/tools/generated/help.ts
|
|
51
51
|
var helpDirectory = `# Available Endpoints
|
|
52
52
|
|
|
53
|
+
[node-inspection]
|
|
54
|
+
annotations Read and manage design annotations and annotation categories.
|
|
55
|
+
selection Read and set the current Figma selection.
|
|
56
|
+
|
|
53
57
|
[design-system]
|
|
54
58
|
components Create and manage reusable components and variant sets.
|
|
55
59
|
fonts Search available fonts in Figma.
|
|
56
60
|
instances Create and manage component instances.
|
|
61
|
+
library Discover and inspect published team library components and styles via Figma REST API.
|
|
57
62
|
styles CRUD for local paint, text, effect, and grid styles.
|
|
58
63
|
variable_collections CRUD for variable collections \u2014 the document-level API for design tokens.
|
|
59
64
|
variables Search and update design variables within a collection.
|
|
@@ -67,6 +72,8 @@ var helpDirectory = `# Available Endpoints
|
|
|
67
72
|
|
|
68
73
|
[creation]
|
|
69
74
|
frames Create and manage frames, shapes, auto-layout containers, sections, and SVG nodes.
|
|
75
|
+
icons Search and create icons from 200k+ open-source icons via Iconify.
|
|
76
|
+
images Search stock photos from Pexels and apply image fills.
|
|
70
77
|
text Create and manage text nodes.
|
|
71
78
|
|
|
72
79
|
[quality]
|
|
@@ -75,19 +82,38 @@ var helpDirectory = `# Available Endpoints
|
|
|
75
82
|
[interaction]
|
|
76
83
|
prototyping Manage prototype interactions, reactions, and navigation flows.
|
|
77
84
|
|
|
78
|
-
[node-inspection]
|
|
79
|
-
selection Read and set the current Figma selection.
|
|
80
|
-
|
|
81
85
|
Topics:
|
|
82
86
|
missing_tools Why create or edit tools are missing and how to fix it
|
|
83
87
|
|
|
84
88
|
Use help(topic: "<endpoint>") for endpoint details.
|
|
85
89
|
Use help(topic: "<endpoint>.<method>") for method details.`;
|
|
86
90
|
var helpEndpoints = {
|
|
91
|
+
"annotations": {
|
|
92
|
+
"summary": '# annotations\nRead and manage design annotations and annotation categories.\n\nMethods:\n get Read all annotations on a node (full detail with resolved category names) [read]\n list Search annotations across a subtree, optionally filtered by category [read]\n set Replace all annotations on a node [edit]\n add Add an annotation to a node [edit]\n remove Remove an annotation from a node by index [edit]\n categories List all annotation categories in the file [read]\n create_category Create a new annotation category [create]\n update_category Update an annotation category\'s label or color [edit]\n delete_category Delete an annotation category [edit]\n\n// Annotations are designer-authored notes attached to nodes \u2014 specs, intent, constraints.\n// Every node-returning endpoint includes an annotation brief: { label, properties?, categoryId? }.\n// Use this endpoint for full CRUD and to manage annotation categories.\n// Workflow: read annotations on a node with get, add new ones with add, manage categories with categories/create_category.\n// Batch: get/set/add/remove accept items:[{id, ...}] for multi-node operations, or single-item params (id, label, etc).\n// properties: measurement indicators Figma displays on the canvas \u2014 validated per node type and state.\n// labelMarkdown: rich text label supporting **bold**, *italic*, `code`, [links](url).\n// categoryId: group annotations by category (e.g. "Spacing", "Typography"). Create categories first.\n// ---\n// AnnotationPropertyType values (node-type-dependent \u2014 invalid ones are rejected with the available list):\n// Dimension: width, height, maxWidth, minWidth, maxHeight, minHeight\n// Paint: fills, strokes, effects, strokeWeight, cornerRadius, opacity\n// Text (TEXT nodes only): textStyleId, textAlignHorizontal, fontFamily, fontStyle, fontSize, fontWeight, lineHeight, letterSpacing\n// Layout (auto-layout only): itemSpacing, padding, layoutMode, alignItems\n// Instance (INSTANCE only): mainComponent\n// Grid (grid layout only): gridRowGap, gridColumnGap, gridRowCount, gridColumnCount, gridRowAnchorIndex, gridColumnAnchorIndex, gridRowSpan, gridColumnSpan\n// AnnotationCategoryColor values: yellow, orange, red, pink, violet, blue, teal, green.\n\nUse annotations(method: "help", topic: "<method>") for method details.',
|
|
93
|
+
"methods": {
|
|
94
|
+
"get": '# annotations.get\nRead all annotations on a node (full detail with resolved category names)\n\nExample: annotations(method:"get", id:"1:23")\n\nParams:\n id (string, optional) \u2014 Node ID\n categoryId (string, optional) \u2014 Filter \u2014 only return annotations in this category\n items (array, optional) \u2014 Batch: [{id, categoryId?}, ...]\n id (string, required)\n categoryId (string, optional)',
|
|
95
|
+
"list": '# annotations.list\nSearch annotations across a subtree, optionally filtered by category\n\nExample: annotations(method:"list", parentId:"1:2", categoryId:"113:0")\n\nParams:\n parentId (string, optional) \u2014 Root node to search within (default: current page)\n categoryId (string, optional) \u2014 Filter by category ID\n limit (number, optional) \u2014 Max items per page (default 100)',
|
|
96
|
+
"set": '# annotations.set\nReplace all annotations on a node\n\nExample: annotations(method:"set", id:"1:23", annotations:[{label:"Spacing: 16px", properties:["padding"]}])\n\nParams:\n id (string, optional) \u2014 Node ID\n annotations (array, optional) \u2014 Array of annotation objects to set (replaces all existing)\n label (string, optional) \u2014 Plain text label\n labelMarkdown (string, optional) \u2014 Rich text label (Markdown)\n properties (string[], optional) \u2014 Measurement property types to display\n categoryId (string, optional) \u2014 Category ID\n items (array, optional) \u2014 Batch: [{id, annotations: [...]}, ...]\n id (string, required)\n annotations (array, required) \u2014 Annotations to set on this node',
|
|
97
|
+
"add": '# annotations.add\nAdd an annotation to a node\n\nExample: annotations(method:"add", id:"1:23", labelMarkdown:"**Width**: 320px fixed", properties:["width"])\n\nParams:\n id (string, optional) \u2014 Node ID\n label (string, optional) \u2014 Plain text label (use label or labelMarkdown, not both)\n labelMarkdown (string, optional) \u2014 Rich text label with Markdown formatting\n properties (string[], optional) \u2014 Measurement property types to display on canvas\n categoryId (string, optional) \u2014 Category ID to group this annotation\n items (array, optional) \u2014 Batch: [{id, label?, labelMarkdown?, properties?, categoryId?}, ...]\n id (string, required)\n label (string, optional)\n labelMarkdown (string, optional)\n properties (string[], optional)\n categoryId (string, optional)',
|
|
98
|
+
"remove": '# annotations.remove\nRemove an annotation from a node by index\n\nExample: annotations(method:"remove", id:"1:23", index:0)\n\nParams:\n id (string, optional) \u2014 Node ID\n index (number, optional) \u2014 Annotation index to remove (from get response)\n items (array, optional) \u2014 Batch: [{id, index}, ...]\n id (string, required)\n index (number, required)',
|
|
99
|
+
"categories": '# annotations.categories\nList all annotation categories in the file\n\nExample: annotations(method:"categories")\n\nNo params.',
|
|
100
|
+
"create_category": '# annotations.create_category\nCreate a new annotation category\n\nExample: annotations(method:"create_category", label:"Spacing", color:"blue")\n\nParams:\n label (string, required) \u2014 Category label\n color (yellow | orange | red | pink | violet | blue | teal | green, required) \u2014 Category color',
|
|
101
|
+
"update_category": `# annotations.update_category
|
|
102
|
+
Update an annotation category's label or color
|
|
103
|
+
|
|
104
|
+
Example: annotations(method:"update_category", id:"cat:123", label:"Layout", color:"teal")
|
|
105
|
+
|
|
106
|
+
Params:
|
|
107
|
+
id (string, required) \u2014 Category ID
|
|
108
|
+
label (string, optional) \u2014 New label
|
|
109
|
+
color (yellow | orange | red | pink | violet | blue | teal | green, optional) \u2014 New color`,
|
|
110
|
+
"delete_category": '# annotations.delete_category\nDelete an annotation category\n\nExample: annotations(method:"delete_category", id:"cat:123")\n\nParams:\n id (string, required) \u2014 Category ID to delete'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
87
113
|
"components": {
|
|
88
|
-
"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.',
|
|
114
|
+
"summary": '# components\nCreate and manage reusable components and variant sets.\n\nMethods:\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n list List local component names (variant sets as single entries) [read]\n get Get component detail \u2014 property definitions + optional node tree for structural inspection [read]\n create Create components [create]\n commit Commit a staged component \u2014 unwraps from [STAGED] container into the original target location. [edit]\n update Add, edit, or delete component properties [edit]\n delete Delete components or component sets [edit]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// properties: escape hatch \u2014 set any Figma node property directly. Use only when no dedicated field exists.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}}\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.\n// Unknown keys produce a warning, preventing silent failures.\n// Components are reusable design elements. Instances stay linked to the component and inherit changes.\n// Workflow: create component (with properties) \u2192 add children \u2192 create instances via instances.create.\n// ---\n// A component set (variant set) groups related components as variants (e.g. Button/Primary, Button/Secondary).\n// Property types: BOOLEAN (toggle visibility), TEXT (editable text), INSTANCE_SWAP (swap child instance), VARIANT (variant picker).\n// exposeText: when creating from_node, text children become editable TEXT properties on the component.\n// Auto-bind: TEXT properties auto-bind to text children with matching names (case-insensitive).\n// Example: properties:[{propertyName:"Label", type:"TEXT", defaultValue:"Click"}] binds to a child text node named "Label".\n// text.create accepts componentPropertyName to bind on creation \u2014 walks up ancestors to find the nearest component.\n// For nested text (text inside frames inside a component), componentPropertyName resolves via ancestor walk. Alternatively, pass componentId explicitly.\n// For existing nodes with many text children, prefer components(method:"create", type:"from_node", exposeText:true) \u2014 it auto-discovers, creates TEXT properties, and binds all text nodes in one operation.\n// Property keys: read returns clean names ("Label"), write requires the #suffix ("Label#1:0"). Call components.get(id) to discover exact keys before edit/delete.\n// ComponentItem accepts the same params as FrameItem (layout, fill, stroke, sizing, min/max).\n// A component IS a frame \u2014 create it directly with all layout properties, then add children.\n// SIZING: Components with text need a width constraint \u2014 set width + layoutSizingHorizontal:"FIXED".\n// Without it, text won\'t wrap and the component grows unboundedly.\n// HUG on both axes is only correct for intrinsically-sized elements (buttons, badges, icons).\n// action: "add" (default) \u2014 requires type + defaultValue. "edit" \u2014 pass defaultValue to change value, name to rename property. "delete" \u2014 just propertyName#suffix.\n// action: "rename_variant" \u2014 renames a variant option VALUE (not the property). Pass defaultValue=current option name, name=new option name.\n// For VARIANT properties: "edit" with defaultValue reorders children to set the default variant.\n// Adding variants: clone an existing variant into the set with a new name. See guidelines(topic:"component-structure") for workflow.\n\nUse components(method: "help", topic: "<method>") for method details.',
|
|
89
115
|
"methods": {
|
|
90
|
-
"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.",
|
|
116
|
+
"clone": "# components.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
|
|
91
117
|
"audit": `# components.audit
|
|
92
118
|
Run lint on a node \u2014 returns severity-ranked findings
|
|
93
119
|
|
|
@@ -116,15 +142,17 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
116
142
|
width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
|
|
117
143
|
height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
|
|
118
144
|
rotation (number, optional) \u2014 Rotation in degrees (0-360)
|
|
119
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
120
145
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
121
146
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
147
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
122
148
|
blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
|
|
123
|
-
|
|
149
|
+
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
124
150
|
fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
|
|
125
151
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
126
152
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
127
153
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
154
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
|
|
155
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
|
|
128
156
|
strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
|
|
129
157
|
strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
|
|
130
158
|
strokeStyleName (string, optional) \u2014 Paint style name for stroke
|
|
@@ -135,13 +163,11 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
135
163
|
strokeLeftWeight (string, optional)
|
|
136
164
|
strokeRightWeight (string, optional)
|
|
137
165
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
138
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
139
166
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
140
167
|
topLeftRadius (string, optional)
|
|
141
168
|
topRightRadius (string, optional)
|
|
142
169
|
bottomRightRadius (string, optional)
|
|
143
170
|
bottomLeftRadius (string, optional)
|
|
144
|
-
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
145
171
|
layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
|
|
146
172
|
layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
|
|
147
173
|
padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
|
|
@@ -151,15 +177,18 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
151
177
|
paddingLeft (string, optional)
|
|
152
178
|
primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
|
|
153
179
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
154
|
-
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
155
|
-
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
156
180
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
157
181
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
182
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
183
|
+
overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
|
|
184
|
+
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
185
|
+
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
186
|
+
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
158
187
|
minWidth (number, optional) \u2014 Min width for responsive auto-layout
|
|
159
188
|
maxWidth (number, optional) \u2014 Max width for responsive auto-layout
|
|
160
189
|
minHeight (number, optional) \u2014 Min height for responsive auto-layout
|
|
161
190
|
maxHeight (number, optional) \u2014 Max height for responsive auto-layout
|
|
162
|
-
|
|
191
|
+
annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
|
|
163
192
|
description (string, optional) \u2014 Component description (shown in Figma's component panel)
|
|
164
193
|
children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, componentPropertyName?, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, componentPropertyName?, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. componentPropertyName auto-creates and binds a TEXT (text) or INSTANCE_SWAP (instance) property. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Label", componentPropertyName:"Label", fontSize:14, fontColorVariableName:"text/primary", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Actions", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", componentPropertyName:"Action", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}]
|
|
165
194
|
|
|
@@ -182,15 +211,17 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
182
211
|
width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
|
|
183
212
|
height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
|
|
184
213
|
rotation (number, optional) \u2014 Rotation in degrees (0-360)
|
|
185
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
186
214
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
187
215
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
216
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
188
217
|
blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
|
|
189
|
-
|
|
218
|
+
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
190
219
|
fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
|
|
191
220
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
192
221
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
193
222
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
223
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
|
|
224
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
|
|
194
225
|
strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
|
|
195
226
|
strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
|
|
196
227
|
strokeStyleName (string, optional) \u2014 Paint style name for stroke
|
|
@@ -201,13 +232,11 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
201
232
|
strokeLeftWeight (string, optional)
|
|
202
233
|
strokeRightWeight (string, optional)
|
|
203
234
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
204
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
205
235
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
206
236
|
topLeftRadius (string, optional)
|
|
207
237
|
topRightRadius (string, optional)
|
|
208
238
|
bottomRightRadius (string, optional)
|
|
209
239
|
bottomLeftRadius (string, optional)
|
|
210
|
-
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
211
240
|
layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
|
|
212
241
|
layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
|
|
213
242
|
padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
|
|
@@ -217,15 +246,18 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
217
246
|
paddingLeft (string, optional)
|
|
218
247
|
primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
|
|
219
248
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
220
|
-
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
221
|
-
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
222
249
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
223
250
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
251
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
252
|
+
overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
|
|
253
|
+
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
254
|
+
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
255
|
+
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
224
256
|
minWidth (number, optional) \u2014 Min width for responsive auto-layout
|
|
225
257
|
maxWidth (number, optional) \u2014 Max width for responsive auto-layout
|
|
226
258
|
minHeight (number, optional) \u2014 Min height for responsive auto-layout
|
|
227
259
|
maxHeight (number, optional) \u2014 Max height for responsive auto-layout
|
|
228
|
-
|
|
260
|
+
annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
|
|
229
261
|
componentIds (string[], optional) \u2014 Existing component IDs to combine (min 2). Alternative to children.
|
|
230
262
|
variantPropertyName (string, optional) \u2014 Rename the auto-generated variant property (default: 'Property 1')
|
|
231
263
|
children (array, optional) \u2014 Inline variant components. Each must be {type:"component", name, children?, ...frame_params}. All variants must share the same child structure. Alternative to componentIds \u2014 do not combine both.`,
|
|
@@ -260,7 +292,7 @@ Discriminant: type (component | from_node | variant_set)
|
|
|
260
292
|
}
|
|
261
293
|
},
|
|
262
294
|
"frames": {
|
|
263
|
-
"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.',
|
|
295
|
+
"summary": '# frames\nCreate and manage frames, shapes, auto-layout containers, sections, and SVG nodes.\n\nMethods:\n get Get serialized node data [read]\n list Search for nodes (returns stubs only \u2014 use get with depth for full properties) [read]\n update Patch node properties [edit]\n delete Delete nodes [edit]\n clone Duplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition. [create]\n audit Run lint on a node \u2014 returns severity-ranked findings [read]\n reparent Move nodes into a new parent [edit]\n create Create frame-like containers [create]\n commit Commit a staged node \u2014 unwraps from [STAGED] container into the original target location. [edit]\n export Export a node as PNG, JPG, SVG, SVG_STRING, or PDF [read]\n\n// depth: omit \u2192 id+name stubs | 0 \u2192 props + child stubs | N \u2192 recurse N | -1 \u2192 full tree\n// fields: whitelist e.g. ["fills","opacity"] \u2014 id, name, type always included. Pass ["*"] for all.\n// layoutSizingHorizontal/Vertical: FIXED | HUG | FILL \u2014 how the node sizes within auto-layout.\n// Colors: fillVariableName/strokeVariableName bind by name \u2014 preferred over raw color values.\n// Note: node-based endpoints (frames, text, instances, components) use `results` as the list key.\n// Standalone endpoints (styles, variables, variable_collections) use `items`. Components.list uses `items` (catalog view).\n// ---\n// visible: false hides the node. Omitted from response when true (the default).\n// locked: true prevents editing in Figma UI. Omitted when false (the default).\n// rotation: degrees (0-360). Omitted when 0.\n// blendMode: layer blend mode. Omitted when PASS_THROUGH (the default).\n// layoutPositioning: ABSOLUTE = floating inside auto-layout parent. Omitted when AUTO (the default).\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// constraints: position behavior in non-auto-layout parents. Ignored inside auto-layout frames.\n// bindings: bind design variables to node properties. field uses slash path: "fills/0/color" (first fill), "strokes/0/color", "opacity", "width", "height", "cornerRadius", "paddingLeft", "itemSpacing".\n// explicitMode: pin a variable mode on this node. Use { collectionName, modeName } (preferred) or { collectionId, modeId }.\n// properties: escape hatch \u2014 set any Figma node property directly. Use only when no dedicated field exists.\ninterface Node {\n id: string; name: string; type: string;\n visible?: boolean; // omitted when true\n locked?: boolean; // omitted when false\n opacity?: number; // omitted when 1\n rotation?: number; // omitted when 0\n blendMode?: string; // omitted when PASS_THROUGH\n layoutPositioning?: "AUTO" | "ABSOLUTE";\n layoutSizingHorizontal?: "FIXED" | "HUG" | "FILL";\n layoutSizingVertical?: "FIXED" | "HUG" | "FILL";\n minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number;\n absoluteBoundingBox: { x: number; y: number; width: number; height: number };\n fills?: Paint[]; // solid: {type: "SOLID", color: {r, g, b, a}}\n strokes?: Paint[];\n effects?: Effect[]; // DROP_SHADOW | INNER_SHADOW | LAYER_BLUR | BACKGROUND_BLUR\n children?: NodeStub[]; // stubs: {id, name, type} \u2014 use depth to expand\n}\n// PatchItem uses flat params matching create shape \u2014 no nested sub-objects.\n// Fill/stroke/corner/layout/text params are identical to frames.create and text.create.\n// Unknown keys produce a warning, preventing silent failures.\n// Frames are the primary container in Figma. Use auto_layout for responsive containers.\n// Sizing: FIXED = explicit size, HUG = shrink to children, FILL = expand to fill parent.\n// Fill: pass fills:[{type:"SOLID", color:"#hex"}] or [] for transparent. Shorthand: fillColor:"#3B82F6" (auto-binds to matching variable/style).\n// Also: fillVariableName:"bg/primary", fillStyleName:"Surface/Primary".\n// Image fill: imageUrl accepts "pexel:<id>", a public URL, or a local file path. SVGs become vector nodes; raster images become IMAGE fills. imageScaleMode: FILL (default), FIT, CROP, TILE.\n// Stroke: pass strokes:[{type:"SOLID", color:"#hex"}] or [] to clear. Shorthand: strokeColor:"#000", strokeVariableName:"border/default".\n// Token fields (cornerRadius, opacity, itemSpacing, padding, strokeWeight): pass number for value, string for variable name/ID.\n// ---\n// SIZING: Always think about both axes. Containers with text need a width constraint \u2014 set width + layoutSizingHorizontal:"FIXED".\n// HUG/HUG is only correct for intrinsically-sized elements (buttons, badges, icons).\n// Smart defaults inside auto-layout parent: cross-axis defaults to FILL, primary axis stays HUG.\n// FILL only works inside an auto-layout parent. Use FIXED for top-level frames.\n// minWidth/maxWidth/minHeight/maxHeight: responsive constraints for auto-layout children.\n// clipsContent: true (default) clips children to the frame bounds. Set false for overflow-visible.\n// Sections are top-level organizers (like artboards) \u2014 they cannot be nested inside frames.\n// Shape primitives: rectangle, ellipse, line \u2014 for decorative/visual elements (not containers).\n// group: wraps existing nodes into a Group. boolean_operation: UNION/SUBTRACT/INTERSECT/EXCLUDE combines shapes.\n// SVG create: pass raw SVG markup string (e.g. "<svg>...</svg>") \u2014 Figma converts it to vector nodes.\n\nUse frames(method: "help", topic: "<method>") for method details.',
|
|
264
296
|
"methods": {
|
|
265
297
|
"get": '# frames.get\nGet serialized node data\n\nParams:\n id (string, required) \u2014 Node ID\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.\n verbose (boolean, optional) \u2014 Include all properties (bounding box, constraints, text style details). Default false \u2014 returns slim, actionable output.',
|
|
266
298
|
"list": '# frames.list\nSearch for nodes (returns stubs only \u2014 use get with depth for full properties)\n\nParams:\n query (string, optional) \u2014 Name search query (case-insensitive substring match)\n types (string[], optional) \u2014 Filter by node types (e.g. ["FRAME", "TEXT"])\n parentId (string, optional) \u2014 Search only within this subtree\n fields (string[], optional) \u2014 Property whitelist. Identity fields (id, name, type) always included. Omit for stubs on list, full on get. Pass ["*"] for all.\n offset (number, optional) \u2014 Skip N items for pagination (default 0)\n limit (number, optional) \u2014 Max items per page (default 100)',
|
|
@@ -283,15 +315,14 @@ Params:
|
|
|
283
315
|
strokeLeftWeight (string, optional)
|
|
284
316
|
strokeRightWeight (string, optional)
|
|
285
317
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
286
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
287
318
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
288
319
|
topLeftRadius (string, optional)
|
|
289
320
|
topRightRadius (string, optional)
|
|
290
321
|
bottomRightRadius (string, optional)
|
|
291
322
|
bottomLeftRadius (string, optional)
|
|
292
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
293
323
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
294
324
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
325
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
295
326
|
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)
|
|
296
327
|
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
297
328
|
layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: NONE)
|
|
@@ -305,6 +336,7 @@ Params:
|
|
|
305
336
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
306
337
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
307
338
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
339
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
308
340
|
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
309
341
|
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
310
342
|
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
@@ -336,6 +368,8 @@ Params:
|
|
|
336
368
|
width (number, optional)
|
|
337
369
|
height (number, optional)
|
|
338
370
|
clearFill (boolean, optional) \u2014 Remove all fills
|
|
371
|
+
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.
|
|
372
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
|
|
339
373
|
effects (array, optional) \u2014 Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR)
|
|
340
374
|
overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
|
|
341
375
|
constraints (object, optional)
|
|
@@ -345,9 +379,10 @@ Params:
|
|
|
345
379
|
variableId (string, optional)
|
|
346
380
|
explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
|
|
347
381
|
exportSettings (array, optional) \u2014 Export settings
|
|
382
|
+
annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
|
|
348
383
|
properties (object, optional) \u2014 Direct Figma API props (escape hatch)`,
|
|
349
384
|
"delete": "# frames.delete\nDelete nodes\n\nParams:\n id (string, optional) \u2014 Single node ID\n items (array, optional) \u2014 Batch: [{id}, ...]\n id (string, optional)",
|
|
350
|
-
"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.",
|
|
385
|
+
"clone": "# frames.clone\nDuplicate nodes \u2014 produces a same-type copy (frame\u2192frame, instance\u2192instance, component\u2192component). Instance clones reference the same source component; they do not duplicate the component definition.\n\nParams:\n id (string, optional) \u2014 Node ID\n name (string, optional) \u2014 Rename the clone (set before appending to parent \u2014 required when cloning a variant into its component set to avoid duplicate names)\n parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.\n x (number, optional) \u2014 X position (default: 0)\n y (number, optional) \u2014 Y position (default: 0)\n items (array, optional) \u2014 Batch: [{id, name?, parentId?, x?, y?}, ...]. Alternative to single-item params.\n id (string, required) \u2014 Node ID to clone\n name (string, optional) \u2014 Rename the clone\n parentId (string, optional) \u2014 Target parent\n x (number, optional)\n y (number, optional)\n depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
|
|
351
386
|
"audit": `# frames.audit
|
|
352
387
|
Run lint on a node \u2014 returns severity-ranked findings
|
|
353
388
|
|
|
@@ -374,15 +409,17 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
374
409
|
width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
|
|
375
410
|
height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
|
|
376
411
|
rotation (number, optional) \u2014 Rotation in degrees (0-360)
|
|
377
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
378
412
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
379
413
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
414
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
380
415
|
blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
|
|
381
|
-
|
|
416
|
+
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
382
417
|
fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
|
|
383
418
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
384
419
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
385
420
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
421
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
|
|
422
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
|
|
386
423
|
strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
|
|
387
424
|
strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
|
|
388
425
|
strokeStyleName (string, optional) \u2014 Paint style name for stroke
|
|
@@ -393,13 +430,11 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
393
430
|
strokeLeftWeight (string, optional)
|
|
394
431
|
strokeRightWeight (string, optional)
|
|
395
432
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
396
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
397
433
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
398
434
|
topLeftRadius (string, optional)
|
|
399
435
|
topRightRadius (string, optional)
|
|
400
436
|
bottomRightRadius (string, optional)
|
|
401
437
|
bottomLeftRadius (string, optional)
|
|
402
|
-
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
403
438
|
layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: auto \u2014 NONE when width+height set, otherwise inferred from layout props)
|
|
404
439
|
layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
|
|
405
440
|
padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
|
|
@@ -409,15 +444,18 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
409
444
|
paddingLeft (string, optional)
|
|
410
445
|
primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
|
|
411
446
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
412
|
-
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
413
|
-
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
414
447
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
415
448
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
449
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
450
|
+
overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
|
|
451
|
+
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
452
|
+
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
453
|
+
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
416
454
|
minWidth (number, optional) \u2014 Min width for responsive auto-layout
|
|
417
455
|
maxWidth (number, optional) \u2014 Max width for responsive auto-layout
|
|
418
456
|
minHeight (number, optional) \u2014 Min height for responsive auto-layout
|
|
419
457
|
maxHeight (number, optional) \u2014 Max height for responsive auto-layout
|
|
420
|
-
|
|
458
|
+
annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
|
|
421
459
|
clipsContent (boolean, optional)
|
|
422
460
|
children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Title", fontSize:20, layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.
|
|
423
461
|
|
|
@@ -430,15 +468,17 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
430
468
|
width (number, optional) \u2014 Width in px (omit to shrink-to-content via HUG)
|
|
431
469
|
height (number, optional) \u2014 Height in px (omit to shrink-to-content via HUG)
|
|
432
470
|
rotation (number, optional) \u2014 Rotation in degrees (0-360)
|
|
433
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
434
471
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
435
472
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
473
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
436
474
|
blendMode (PASS_THROUGH | NORMAL | DARKEN | MULTIPLY | LINEAR_BURN | COLOR_BURN | LIGHTEN | SCREEN | LINEAR_DODGE | COLOR_DODGE | OVERLAY | SOFT_LIGHT | HARD_LIGHT | DIFFERENCE | EXCLUSION | HUE | SATURATION | COLOR | LUMINOSITY, optional)
|
|
437
|
-
|
|
475
|
+
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
438
476
|
fills (array, optional) \u2014 Fill paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] for transparent. Primary way to set fills.
|
|
439
477
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
440
478
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
441
479
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
480
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>' for Pexels photos, a public URL, or a local file path. SVGs are inserted as vectors; raster images become IMAGE fills.
|
|
481
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
|
|
442
482
|
strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear. Primary way to set strokes.
|
|
443
483
|
strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
|
|
444
484
|
strokeStyleName (string, optional) \u2014 Paint style name for stroke
|
|
@@ -449,13 +489,11 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
449
489
|
strokeLeftWeight (string, optional)
|
|
450
490
|
strokeRightWeight (string, optional)
|
|
451
491
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
452
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
453
492
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
454
493
|
topLeftRadius (string, optional)
|
|
455
494
|
topRightRadius (string, optional)
|
|
456
495
|
bottomRightRadius (string, optional)
|
|
457
496
|
bottomLeftRadius (string, optional)
|
|
458
|
-
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
459
497
|
layoutMode (HORIZONTAL | VERTICAL, required) \u2014 Primary axis direction
|
|
460
498
|
layoutWrap (NO_WRAP | WRAP, optional) \u2014 Wrap children to new rows (HORIZONTAL layout only \u2014 Figma does not support WRAP on VERTICAL layouts). Use column frames inside a HORIZONTAL parent for vertical grid patterns.
|
|
461
499
|
padding (string, optional) \u2014 All edges (number) or variable name (string). Per-edge: paddingTop, paddingRight, paddingBottom, paddingLeft.
|
|
@@ -465,15 +503,18 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
465
503
|
paddingLeft (string, optional)
|
|
466
504
|
primaryAxisAlignItems (MIN | MAX | CENTER | SPACE_BETWEEN, optional)
|
|
467
505
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
468
|
-
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
469
|
-
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
470
506
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
471
507
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
508
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
509
|
+
overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
|
|
510
|
+
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
511
|
+
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
512
|
+
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
472
513
|
minWidth (number, optional) \u2014 Min width for responsive auto-layout
|
|
473
514
|
maxWidth (number, optional) \u2014 Max width for responsive auto-layout
|
|
474
515
|
minHeight (number, optional) \u2014 Min height for responsive auto-layout
|
|
475
516
|
maxHeight (number, optional) \u2014 Max height for responsive auto-layout
|
|
476
|
-
|
|
517
|
+
annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties validated per node type.
|
|
477
518
|
clipsContent (boolean, optional)
|
|
478
519
|
nodeIds (string[], optional) \u2014 Existing node IDs to wrap into auto-layout
|
|
479
520
|
children (array, optional) \u2014 Inline child nodes \u2014 build nested trees in one call. Types: text: {type:"text", text, fontFamily?, fontSize?, fontWeight?, fontStyle?, fontColor?, layoutSizingHorizontal?}. frame: {type:"frame", name?, layoutMode?, fillColor?, width?, layoutSizingHorizontal?, children?}. instance: {type:"instance", componentId, variantProperties?, properties?}. component: {type:"component", name, children?}. All params from text/frame endpoints are supported on their respective types. Always set layoutSizingHorizontal + layoutSizingVertical on children inside auto-layout parents (FILL, HUG, or FIXED). Example: children:[{type:"text", text:"Title", fontSize:20, layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}, {type:"frame", name:"Row", layoutMode:"HORIZONTAL", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG", itemSpacing:8, children:[{type:"instance", componentId:"1:2", layoutSizingHorizontal:"FILL", layoutSizingVertical:"HUG"}]}] Inside components: add componentPropertyName to auto-bind TEXT or INSTANCE_SWAP properties.
|
|
@@ -490,6 +531,8 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
490
531
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
491
532
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
492
533
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
534
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
|
|
535
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
|
|
493
536
|
|
|
494
537
|
## rectangle \u2014 Rectangle shape node
|
|
495
538
|
name (string, optional) \u2014 Layer name (default: 'Rectangle')
|
|
@@ -502,6 +545,8 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
502
545
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
503
546
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
504
547
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
548
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
|
|
549
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
|
|
505
550
|
strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
|
|
506
551
|
strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
|
|
507
552
|
strokeVariableName (string, optional) \u2014 Color variable by name for stroke
|
|
@@ -514,6 +559,7 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
514
559
|
opacity (string, optional)
|
|
515
560
|
layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
|
|
516
561
|
layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
|
|
562
|
+
annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
|
|
517
563
|
|
|
518
564
|
## ellipse \u2014 Ellipse/circle shape node
|
|
519
565
|
name (string, optional) \u2014 Layer name (default: 'Ellipse')
|
|
@@ -526,6 +572,8 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
526
572
|
fillColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid fill (auto-binds to matching variable/style)
|
|
527
573
|
fillStyleName (string, optional) \u2014 Paint style name for fill
|
|
528
574
|
fillVariableName (string, optional) \u2014 Color variable by name e.g. 'bg/primary'
|
|
575
|
+
imageUrl (string, optional) \u2014 Image source \u2014 'pexel:<id>', public URL, or local file path
|
|
576
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled (default: FILL)
|
|
529
577
|
strokes (array, optional) \u2014 Stroke paints array \u2014 e.g. [{type: 'SOLID', color: '#hex'}] or [] to clear
|
|
530
578
|
strokeColor (Color, optional) \u2014 Shorthand \u2014 sets a single solid stroke (auto-binds to matching variable/style)
|
|
531
579
|
strokeVariableName (string, optional) \u2014 Color variable by name for stroke
|
|
@@ -533,6 +581,7 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
533
581
|
opacity (string, optional)
|
|
534
582
|
layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent
|
|
535
583
|
layoutSizingVertical (FIXED | FILL, optional) \u2014 Vertical sizing in auto-layout parent
|
|
584
|
+
annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
|
|
536
585
|
|
|
537
586
|
## line \u2014 Line shape node
|
|
538
587
|
name (string, optional) \u2014 Layer name (default: 'Line')
|
|
@@ -547,6 +596,7 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
547
596
|
strokeWeight (string, optional) \u2014 Line thickness (default: 1)
|
|
548
597
|
opacity (string, optional)
|
|
549
598
|
layoutSizingHorizontal (FIXED | FILL, optional) \u2014 Horizontal sizing in auto-layout parent (defaults to FILL in vertical auto-layout)
|
|
599
|
+
annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
|
|
550
600
|
|
|
551
601
|
## group \u2014 Group existing nodes together
|
|
552
602
|
nodeIds (string[], required) \u2014 Node IDs to group (min 1)
|
|
@@ -560,25 +610,65 @@ Discriminant: type (frame | auto_layout | section | rectangle | ellipse | line |
|
|
|
560
610
|
parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
|
|
561
611
|
|
|
562
612
|
## svg \u2014 Create node from SVG markup
|
|
613
|
+
fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
|
|
614
|
+
fillVariableName (string, optional) \u2014 Color variable by name for vector fills
|
|
615
|
+
strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
|
|
616
|
+
strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes
|
|
563
617
|
svg (string, required) \u2014 SVG markup string
|
|
564
618
|
name (string, optional) \u2014 Layer name (default: 'SVG')
|
|
565
619
|
parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
|
|
566
620
|
x (number, optional) \u2014 X position (default: 0)
|
|
567
|
-
y (number, optional) \u2014 Y position (default: 0)
|
|
568
|
-
fillStyleName (string, optional) \u2014 Paint style to apply to vector fills
|
|
569
|
-
fillVariableName (string, optional) \u2014 Color variable by name for vector fills
|
|
570
|
-
strokeStyleName (string, optional) \u2014 Paint style to apply to vector strokes
|
|
571
|
-
strokeVariableName (string, optional) \u2014 Color variable by name for vector strokes`,
|
|
621
|
+
y (number, optional) \u2014 Y position (default: 0)`,
|
|
572
622
|
"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',
|
|
573
623
|
"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)"
|
|
574
624
|
}
|
|
575
625
|
},
|
|
626
|
+
"icons": {
|
|
627
|
+
"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.',
|
|
628
|
+
"methods": {
|
|
629
|
+
"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)',
|
|
630
|
+
"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)',
|
|
631
|
+
"create": `# icons.create
|
|
632
|
+
Create an icon node in Figma from an Iconify icon name
|
|
633
|
+
|
|
634
|
+
Example: icons(method:"create", icon:"lucide:home", size:24, colorVariableName:"text/primary", parentId:"1:2")
|
|
635
|
+
|
|
636
|
+
Params:
|
|
637
|
+
icon (string, required) \u2014 Icon name \u2014 "prefix:name" e.g. "lucide:home", "mdi:account"
|
|
638
|
+
size (number, optional) \u2014 Icon size in px (default 24, square)
|
|
639
|
+
name (string, optional) \u2014 Layer name (default: icon name)
|
|
640
|
+
parentId (string, optional) \u2014 Parent node ID. Omit for current page root.
|
|
641
|
+
x (number, optional) \u2014 X position (default: 0)
|
|
642
|
+
y (number, optional) \u2014 Y position (default: 0)
|
|
643
|
+
colorVariableName (string, optional) \u2014 Color variable for the icon \u2014 auto-detects fill vs stroke (e.g. 'text/primary')
|
|
644
|
+
colorStyleName (string, optional) \u2014 Paint style for the icon \u2014 auto-detects fill vs stroke (e.g. 'Icon/Primary')`
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
"images": {
|
|
648
|
+
"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.',
|
|
649
|
+
"methods": {
|
|
650
|
+
"search": `# images.search
|
|
651
|
+
Search photos by keyword via Pexels API
|
|
652
|
+
|
|
653
|
+
Example: images(method:"search", query:"sunset beach", orientation:"landscape", per_page:5)
|
|
654
|
+
|
|
655
|
+
Params:
|
|
656
|
+
query (string, required) \u2014 Search keyword (e.g. "sunset", "office", "nature")
|
|
657
|
+
orientation (landscape | portrait | square, optional) \u2014 Filter by photo orientation
|
|
658
|
+
size (large | medium | small, optional) \u2014 Minimum photo size
|
|
659
|
+
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
|
|
660
|
+
locale (string, optional) \u2014 Locale for search (e.g. 'en-US', 'ja-JP'). Default: en-US
|
|
661
|
+
page (number, optional) \u2014 Page number for pagination (default: 1)
|
|
662
|
+
per_page (number, optional) \u2014 Results per page (default: 15, max: 80)`,
|
|
663
|
+
"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'
|
|
664
|
+
}
|
|
665
|
+
},
|
|
576
666
|
"instances": {
|
|
577
|
-
"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).
|
|
667
|
+
"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.',
|
|
578
668
|
"methods": {
|
|
579
669
|
"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)',
|
|
580
670
|
"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)",
|
|
581
|
-
"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.",
|
|
671
|
+
"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.",
|
|
582
672
|
"audit": `# instances.audit
|
|
583
673
|
Run lint on a node \u2014 returns severity-ranked findings
|
|
584
674
|
|
|
@@ -594,13 +684,13 @@ Params:
|
|
|
594
684
|
"create": `# instances.create
|
|
595
685
|
Create component instances
|
|
596
686
|
|
|
597
|
-
Example: instances(method:"create", items:[{
|
|
687
|
+
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
|
|
598
688
|
|
|
599
689
|
Params:
|
|
600
690
|
items (InstanceCreateItem[], required) \u2014 Array of {componentId, variantProperties?, x?, y?, parentId?, layoutSizingHorizontal?, ...}
|
|
601
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
602
691
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
603
692
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
693
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
604
694
|
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)
|
|
605
695
|
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
606
696
|
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
@@ -610,7 +700,9 @@ Params:
|
|
|
610
700
|
maxWidth (number, optional) \u2014 Max width for responsive auto-layout
|
|
611
701
|
minHeight (number, optional) \u2014 Min height for responsive auto-layout
|
|
612
702
|
maxHeight (number, optional) \u2014 Max height for responsive auto-layout
|
|
613
|
-
componentId (string,
|
|
703
|
+
componentId (string, optional) \u2014 Local component or component set ID. Pass this OR componentKey.
|
|
704
|
+
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.
|
|
705
|
+
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.
|
|
614
706
|
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.
|
|
615
707
|
variantProperties (object, optional) \u2014 Pick variant e.g. {"Style":"Secondary"}
|
|
616
708
|
properties (object, optional) \u2014 Set component properties inline e.g. {"Label":"Click me", "ShowIcon":true}. Same as instances.update properties.
|
|
@@ -619,6 +711,7 @@ Params:
|
|
|
619
711
|
y (number, optional)
|
|
620
712
|
width (number, optional) \u2014 Override width (resize)
|
|
621
713
|
height (number, optional) \u2014 Override height (resize)
|
|
714
|
+
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.
|
|
622
715
|
parentId (string, optional) \u2014 Parent node ID. Omit to place at current page root.
|
|
623
716
|
depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.`,
|
|
624
717
|
"update": `# instances.update
|
|
@@ -642,15 +735,14 @@ Params:
|
|
|
642
735
|
strokeLeftWeight (string, optional)
|
|
643
736
|
strokeRightWeight (string, optional)
|
|
644
737
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
645
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
646
738
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
647
739
|
topLeftRadius (string, optional)
|
|
648
740
|
topRightRadius (string, optional)
|
|
649
741
|
bottomRightRadius (string, optional)
|
|
650
742
|
bottomLeftRadius (string, optional)
|
|
651
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
652
743
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
653
744
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
745
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
654
746
|
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)
|
|
655
747
|
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
656
748
|
layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: NONE)
|
|
@@ -664,6 +756,7 @@ Params:
|
|
|
664
756
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
665
757
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
666
758
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
759
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
667
760
|
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
668
761
|
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
669
762
|
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
@@ -710,6 +803,67 @@ Params:
|
|
|
710
803
|
"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"
|
|
711
804
|
}
|
|
712
805
|
},
|
|
806
|
+
"library": {
|
|
807
|
+
"summary": `# library
|
|
808
|
+
Discover and inspect published team library components and styles via Figma REST API.
|
|
809
|
+
|
|
810
|
+
Methods:
|
|
811
|
+
list List all published components, sets, and styles. Minimal shapes, no pagination. Populates the MCP name\u2192key registry. [read]
|
|
812
|
+
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]
|
|
813
|
+
|
|
814
|
+
// Discover components and styles published to team libraries \u2014 external files not open in Figma.
|
|
815
|
+
// Requires FIGMA_API_TOKEN env var (Personal Access Token with library_content:read scope).
|
|
816
|
+
// Accepts a file URL/key, a team URL/ID, or falls back to the FIGMA_TEAM_ID env var if neither is passed.
|
|
817
|
+
//
|
|
818
|
+
// Two-step flow (discovery \u2192 use):
|
|
819
|
+
// 1. list \u2192 populates the MCP name\u2192key registry (one-shot, no pagination, no side effects in Figma)
|
|
820
|
+
// 2. get \u2192 rich details for any number of queries: componentPropertyDefinitions, variant options, defaults, usage hint
|
|
821
|
+
// 3. use \u2192 instances(method:"create", items:[{componentName:"..."}]) or frames/text with fillStyleName/textStyleName
|
|
822
|
+
//
|
|
823
|
+
// list returns { libraries: [{ name, sections: [{ name, components, componentSets, styles }] }] }.
|
|
824
|
+
// Libraries are grouped by source Figma file, then by section (containing frame) \u2014 mirroring Figma's Libraries browser.
|
|
825
|
+
// Use the library and section names to identify the right component when multiple libraries expose overlapping names.
|
|
826
|
+
//
|
|
827
|
+
// get returns the same nested hierarchy as list, but each leaf is a full detail object (properties, variant options,
|
|
828
|
+
// defaults, copy-pasteable usage hint) instead of a bare name. Pass library and/or section params to narrow results
|
|
829
|
+
// when names collide \u2014 e.g. library(method:"get", query:"Item", library:"macOS", section:"Sidebars").
|
|
830
|
+
//
|
|
831
|
+
// No import step needed. Every *Name referenced in a later tool call (componentName, fillStyleName,
|
|
832
|
+
// textStyleName, effectStyleName) is auto-resolved from the registry and imported on demand via
|
|
833
|
+
// figma.importComponentByKeyAsync / importStyleByKeyAsync. Local styles always take precedence \u2014
|
|
834
|
+
// library fallback only kicks in when no local style with that exact name exists.
|
|
835
|
+
//
|
|
836
|
+
// The raw 40-char component/style keys NEVER enter agent context \u2014 the MCP holds them internally.
|
|
837
|
+
//
|
|
838
|
+
// list must be called before get / before any name reference in other tools \u2014 the registry is initially empty.
|
|
839
|
+
// Results are cached for 5 minutes.
|
|
840
|
+
//
|
|
841
|
+
// Name collisions across files: first-seen wins; subsequent entries with the same name are re-keyed with
|
|
842
|
+
// " (in <frame>)" suffix in the registry so you can still address them.
|
|
843
|
+
|
|
844
|
+
Use library(method: "help", topic: "<method>") for method details.`,
|
|
845
|
+
"methods": {
|
|
846
|
+
"list": `# library.list
|
|
847
|
+
List all published components, sets, and styles. Minimal shapes, no pagination. Populates the MCP name\u2192key registry.
|
|
848
|
+
|
|
849
|
+
Example: library(method:"list") // uses FIGMA_TEAM_ID env var; or pass file/team explicitly
|
|
850
|
+
|
|
851
|
+
Params:
|
|
852
|
+
file (string, optional) \u2014 File URL or file key \u2014 e.g. 'https://www.figma.com/design/abc123/MyDS' or 'abc123'
|
|
853
|
+
team (string, optional) \u2014 Team URL or team ID. Falls back to FIGMA_TEAM_ID env var if omitted.`,
|
|
854
|
+
"get": `# library.get
|
|
855
|
+
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.
|
|
856
|
+
|
|
857
|
+
Example: library(method:"get", query:["item","header"], library:"macOS", section:"Sidebars") // batch query scoped to a specific library and section
|
|
858
|
+
|
|
859
|
+
Params:
|
|
860
|
+
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.
|
|
861
|
+
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.
|
|
862
|
+
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.
|
|
863
|
+
file (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.
|
|
864
|
+
team (string, optional) \u2014 Only used if the registry is empty \u2014 convenience to run list+get in one step.`
|
|
865
|
+
}
|
|
866
|
+
},
|
|
713
867
|
"lint": {
|
|
714
868
|
"summary": `# lint
|
|
715
869
|
Run design quality and accessibility checks.
|
|
@@ -768,7 +922,18 @@ Methods:
|
|
|
768
922
|
|
|
769
923
|
Use lint(method: "help", topic: "<method>") for method details.`,
|
|
770
924
|
"methods": {
|
|
771
|
-
"check":
|
|
925
|
+
"check": `# lint.check
|
|
926
|
+
Run design linter on a node tree
|
|
927
|
+
|
|
928
|
+
Example: lint(method:"check", nodeId:"0:1", rules:["wcag","hardcoded-color"])
|
|
929
|
+
|
|
930
|
+
Params:
|
|
931
|
+
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.
|
|
932
|
+
rules (string[], optional) \u2014 Rules to run. Default: ["all"]. Categories: "component", "composition", "token", "naming", "wcag"/"accessibility". Or specific rule names.
|
|
933
|
+
maxDepth (number, optional) \u2014 Max tree depth (default: 10)
|
|
934
|
+
maxFindings (number, optional) \u2014 Max findings (default: 50)
|
|
935
|
+
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.
|
|
936
|
+
skipInstances (boolean, optional) \u2014 Skip instance internals \u2014 findings inside instances are owned by the component (default: true)`,
|
|
772
937
|
"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"
|
|
773
938
|
}
|
|
774
939
|
},
|
|
@@ -799,7 +964,7 @@ Use lint(method: "help", topic: "<method>") for method details.`,
|
|
|
799
964
|
}
|
|
800
965
|
},
|
|
801
966
|
"text": {
|
|
802
|
-
"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.',
|
|
967
|
+
"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.',
|
|
803
968
|
"methods": {
|
|
804
969
|
"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.',
|
|
805
970
|
"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)',
|
|
@@ -822,15 +987,14 @@ Params:
|
|
|
822
987
|
strokeLeftWeight (string, optional)
|
|
823
988
|
strokeRightWeight (string, optional)
|
|
824
989
|
strokeAlign (INSIDE | OUTSIDE | CENTER, optional) \u2014 Stroke position (default: INSIDE)
|
|
825
|
-
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
826
990
|
cornerRadius (string, optional) \u2014 All corners (number) or variable name (string). Per-corner: topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius.
|
|
827
991
|
topLeftRadius (string, optional)
|
|
828
992
|
topRightRadius (string, optional)
|
|
829
993
|
bottomRightRadius (string, optional)
|
|
830
994
|
bottomLeftRadius (string, optional)
|
|
831
|
-
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
832
995
|
visible (boolean, optional) \u2014 Show/hide (default true)
|
|
833
996
|
locked (boolean, optional) \u2014 Lock/unlock (default false)
|
|
997
|
+
opacity (string, optional) \u2014 Opacity (0-1) or variable name
|
|
834
998
|
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)
|
|
835
999
|
effectStyleName (string, optional) \u2014 Effect style name (e.g. 'Shadow/Card') for shadows, blurs
|
|
836
1000
|
layoutMode (NONE | HORIZONTAL | VERTICAL, optional) \u2014 Layout direction (default: NONE)
|
|
@@ -844,6 +1008,7 @@ Params:
|
|
|
844
1008
|
counterAxisAlignItems (MIN | MAX | CENTER | BASELINE, optional)
|
|
845
1009
|
itemSpacing (string, optional) \u2014 Spacing between children (number or variable name string, default: 0)
|
|
846
1010
|
counterAxisSpacing (string, optional) \u2014 Gap between wrapped rows (requires layoutWrap: WRAP)
|
|
1011
|
+
strokesIncludedInLayout (boolean, optional) \u2014 Include stroke width in layout measurements (default: false)
|
|
847
1012
|
layoutSizingHorizontal (FIXED | HUG | FILL, optional)
|
|
848
1013
|
layoutSizingVertical (FIXED | HUG | FILL, optional)
|
|
849
1014
|
layoutPositioning (AUTO | ABSOLUTE, optional) \u2014 ABSOLUTE = floating inside auto-layout parent
|
|
@@ -875,6 +1040,8 @@ Params:
|
|
|
875
1040
|
width (number, optional)
|
|
876
1041
|
height (number, optional)
|
|
877
1042
|
clearFill (boolean, optional) \u2014 Remove all fills
|
|
1043
|
+
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.
|
|
1044
|
+
imageScaleMode (FILL | FIT | CROP | TILE, optional) \u2014 How the image is scaled within the frame (default: FILL)
|
|
878
1045
|
effects (array, optional) \u2014 Effect array (DROP_SHADOW, INNER_SHADOW, LAYER_BLUR, BACKGROUND_BLUR)
|
|
879
1046
|
overflowDirection (NONE | HORIZONTAL | VERTICAL | BOTH, optional) \u2014 Scroll overflow in prototype (default: NONE)
|
|
880
1047
|
constraints (object, optional)
|
|
@@ -884,9 +1051,10 @@ Params:
|
|
|
884
1051
|
variableId (string, optional)
|
|
885
1052
|
explicitMode (object, optional) \u2014 Pin variable mode \u2014 use { collectionName, modeName } (preferred) or { collectionId, modeId }
|
|
886
1053
|
exportSettings (array, optional) \u2014 Export settings
|
|
1054
|
+
annotations (array, optional) \u2014 Set annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]. Properties are validated per node type.
|
|
887
1055
|
properties (object, optional) \u2014 Direct Figma API props (escape hatch)`,
|
|
888
1056
|
"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)",
|
|
889
|
-
"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.",
|
|
1057
|
+
"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.",
|
|
890
1058
|
"audit": `# text.audit
|
|
891
1059
|
Run lint on a node \u2014 returns severity-ranked findings
|
|
892
1060
|
|
|
@@ -932,6 +1100,7 @@ Params:
|
|
|
932
1100
|
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)
|
|
933
1101
|
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.
|
|
934
1102
|
componentId (string, optional) \u2014 Target component ID for componentPropertyName binding. When omitted, walks up ancestors to find the nearest COMPONENT or COMPONENT_SET.
|
|
1103
|
+
annotations (array, optional) \u2014 Annotations \u2014 [{label?, labelMarkdown?, properties?, categoryId?}]
|
|
935
1104
|
depth (number, optional) \u2014 Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.`,
|
|
936
1105
|
"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.",
|
|
937
1106
|
"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"
|
|
@@ -1055,6 +1224,7 @@ function registerTools(server, sendCommand, caps, tools) {
|
|
|
1055
1224
|
return { content: [{ type: "text", text }] };
|
|
1056
1225
|
}
|
|
1057
1226
|
if (tool.validate) tool.validate(params);
|
|
1227
|
+
if (tool.preProcess) await tool.preProcess(params);
|
|
1058
1228
|
const command = resolveCommand(tool, params);
|
|
1059
1229
|
params._caps = caps;
|
|
1060
1230
|
const result = await sendCommand(command, params, timeout);
|