create_shape
Creates rectangles, ellipses, lines, polygons, and stars in a Figma file to build or edit designs, then returns the created node.
Instructions
Create a basic shape: RECTANGLE, ELLIPSE, LINE, POLYGON or STAR. Size defaults to 100x100 (height defaults to width). LINE: width is the length (no height; use rotation for direction) and gets a black 1px stroke unless stroke is given. POLYGON uses pointCount (sides, default 3); STAR uses pointCount (default 5) and innerRadius (0-1 ratio, default ~0.38). fill/stroke are hex (#RRGGBB / #RRGGBBAA), fill 'none' removes the default grey fill. cornerRadius works on RECTANGLE/POLYGON/STAR. rotation is in degrees (counter-clockwise, around the top-left corner) and is applied after positioning. Returns the created node.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"shapeType": "<shapeType>"
},
"name": "create_shape"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Position relative to parent. If x, y and parentId are all omitted the node is centred in the viewport | |
| y | No | ||
| file | No | Target file (fileKey, id or name). Defaults to the most recently active file. | |
| fill | No | Hex color or 'none' | |
| name | No | ||
| width | No | Width (LINE: length). Default 100 | |
| height | No | Height (ignored for LINE). Default = width | |
| stroke | No | Hex color or 'none' | |
| parentId | No | Parent frame/group/section id; default current page | |
| rotation | No | Degrees | |
| shapeType | Yes | ||
| pointCount | No | POLYGON sides / STAR points | |
| innerRadius | No | STAR only: inner radius ratio 0-1 | |
| cornerRadius | No | ||
| strokeWeight | No |