Skip to main content
Glama

create_rectangle

Define and insert rectangle shapes into a Figma document, specifying dimensions, position, and optional properties like name, parent node ID, corner radius, and fill/stroke colors. Supports single or multiple rectangle configurations.

Instructions

Creates one or more rectangle shape nodes in the specified Figma document. Accepts either a single rectangle config (via 'rectangle') or an array of configs (via 'rectangles'). Optionally, you can provide a name, a parent node ID to attach the rectangle(s) to, and a corner radius for rounded corners.

Returns:

  • content: Array of objects. Each object contains a type: "text" and a text field with the created rectangle node ID(s).

Input Schema

NameRequiredDescriptionDefault
rectangleNoA single rectangle configuration object. Each object should include coordinates, dimensions, and optional properties for a rectangle.
rectanglesNoAn array of rectangle configuration objects. Each object should include coordinates, dimensions, and optional properties for a rectangle.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "rectangle": { "additionalProperties": false, "description": "A single rectangle configuration object. Each object should include coordinates, dimensions, and optional properties for a rectangle.", "properties": { "cornerRadius": { "description": "The corner radius (in pixels) for rounded corners. Must be >= 0. Example: 8", "minimum": 0, "type": "number" }, "fillColor": { "description": "Optional RGBA fill color for the rectangle. Example: { r: 0.2235, g: 1, b: 0.0784, a: 1 }" }, "height": { "description": "The height of the rectangle in pixels. Must be > 0. Example: 150", "exclusiveMinimum": 0, "type": "number" }, "name": { "description": "The name to assign to the rectangle node in Figma. Example: 'Button Background'", "type": "string" }, "parentId": { "description": "The Figma node ID of the parent to attach the rectangle to. If omitted, the rectangle is added to the root.", "type": "string" }, "strokeColor": { "description": "Optional RGBA stroke color for the rectangle. Example: { r: 0, g: 0, b: 0, a: 1 }" }, "strokeWeight": { "description": "Optional stroke weight for the rectangle.", "type": "number" }, "width": { "description": "The width of the rectangle in pixels. Must be > 0. Example: 300", "exclusiveMinimum": 0, "type": "number" }, "x": { "description": "The X coordinate (in Figma canvas units, pixels) for the top-left corner of the rectangle. Must be >= 0. Example: 100", "minimum": 0, "type": "number" }, "y": { "description": "The Y coordinate (in Figma canvas units, pixels) for the top-left corner of the rectangle. Must be >= 0. Example: 200", "minimum": 0, "type": "number" } }, "required": [ "x", "y", "width", "height" ], "type": "object" }, "rectangles": { "description": "An array of rectangle configuration objects. Each object should include coordinates, dimensions, and optional properties for a rectangle.", "items": { "additionalProperties": false, "properties": { "cornerRadius": { "$ref": "#/properties/rectangle/properties/cornerRadius" }, "fillColor": { "$ref": "#/properties/rectangle/properties/fillColor" }, "height": { "$ref": "#/properties/rectangle/properties/height" }, "name": { "$ref": "#/properties/rectangle/properties/name" }, "parentId": { "$ref": "#/properties/rectangle/properties/parentId" }, "strokeColor": { "$ref": "#/properties/rectangle/properties/strokeColor" }, "strokeWeight": { "$ref": "#/properties/rectangle/properties/strokeWeight" }, "width": { "$ref": "#/properties/rectangle/properties/width" }, "x": { "$ref": "#/properties/rectangle/properties/x" }, "y": { "$ref": "#/properties/rectangle/properties/y" } }, "required": [ "x", "y", "width", "height" ], "type": "object" }, "type": "array" } }, "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amalinakurniasari/conduit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server