create_polygon
Generate custom polygons in Figma using coordinates, dimensions, and optional styling like fill color, stroke color, and weight. Supports single or multiple polygons with node IDs returned.
Instructions
Creates one or more polygons in Figma. Accepts either a single polygon config (via 'polygon') or an array of configs (via 'polygons'). Optionally, you can provide a name, a parent node ID, fill color, stroke color, and stroke weight.
Returns:
content: Array of objects. Each object contains a type: "text" and a text field with the created polygon node ID(s).
Input Schema
Name | Required | Description | Default |
---|---|---|---|
polygon | No | A single polygon configuration object. Each object should include coordinates, dimensions, and optional properties for a polygon. | |
polygons | No | An array of polygon configuration objects. Each object should include coordinates, dimensions, and optional properties for a polygon. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"polygon": {
"additionalProperties": false,
"description": "A single polygon configuration object. Each object should include coordinates, dimensions, and optional properties for a polygon.",
"properties": {
"fillColor": {
"description": "Fill color for the polygon."
},
"height": {
"description": "Height in pixels. Example: 100",
"type": "number"
},
"name": {
"description": "Name for the polygon node.",
"type": "string"
},
"parentId": {
"description": "Figma node ID of the parent.",
"type": "string"
},
"sides": {
"description": "Number of sides (minimum 3). Example: 5",
"minimum": 3,
"type": "number"
},
"strokeColor": {
"description": "Stroke color for the polygon."
},
"strokeWeight": {
"description": "Stroke weight for the polygon.",
"type": "number"
},
"width": {
"description": "Width in pixels. Example: 100",
"type": "number"
},
"x": {
"description": "X coordinate for the top-left corner. Example: 10",
"type": "number"
},
"y": {
"description": "Y coordinate for the top-left corner. Example: 20",
"type": "number"
}
},
"required": [
"x",
"y",
"width",
"height",
"sides"
],
"type": "object"
},
"polygons": {
"description": "An array of polygon configuration objects. Each object should include coordinates, dimensions, and optional properties for a polygon.",
"items": {
"additionalProperties": false,
"properties": {
"fillColor": {
"$ref": "#/properties/polygon/properties/fillColor"
},
"height": {
"$ref": "#/properties/polygon/properties/height"
},
"name": {
"$ref": "#/properties/polygon/properties/name"
},
"parentId": {
"$ref": "#/properties/polygon/properties/parentId"
},
"sides": {
"$ref": "#/properties/polygon/properties/sides"
},
"strokeColor": {
"$ref": "#/properties/polygon/properties/strokeColor"
},
"strokeWeight": {
"$ref": "#/properties/polygon/properties/strokeWeight"
},
"width": {
"$ref": "#/properties/polygon/properties/width"
},
"x": {
"$ref": "#/properties/polygon/properties/x"
},
"y": {
"$ref": "#/properties/polygon/properties/y"
}
},
"required": [
"x",
"y",
"width",
"height",
"sides"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}