create_ellipse
Generate ellipses in Figma using natural language commands with Claude Talk to Figma MCP, simplifying design workflows.
Instructions
Create a new ellipse in Figma
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/tools/creation-tools.ts:217-281 (registration)Direct registration of the 'create_ellipse' MCP tool, including description, Zod input schema, and async handler function that forwards parameters to Figma via sendCommandToFigma.server.tool( "create_ellipse", "Create a new ellipse in Figma", { x: z.number().describe("X position"), y: z.number().describe("Y position"), width: z.number().describe("Width of the ellipse"), height: z.number().describe("Height of the ellipse"), name: z.string().optional().describe("Optional name for the ellipse"), parentId: z.string().optional().describe("Optional parent node ID to append the ellipse to"), fillColor: z .object({ r: z.number().min(0).max(1).describe("Red component (0-1)"), g: z.number().min(0).max(1).describe("Green component (0-1)"), b: z.number().min(0).max(1).describe("Blue component (0-1)"), a: z.number().min(0).max(1).optional().describe("Alpha component (0-1)"), }) .optional() .describe("Fill color in RGBA format"), strokeColor: z .object({ r: z.number().min(0).max(1).describe("Red component (0-1)"), g: z.number().min(0).max(1).describe("Green component (0-1)"), b: z.number().min(0).max(1).describe("Blue component (0-1)"), a: z.number().min(0).max(1).optional().describe("Alpha component (0-1)"), }) .optional() .describe("Stroke color in RGBA format"), strokeWeight: z.number().positive().optional().describe("Stroke weight"), }, async ({ x, y, width, height, name, parentId, fillColor, strokeColor, strokeWeight }) => { try { const result = await sendCommandToFigma("create_ellipse", { x, y, width, height, name: name || "Ellipse", parentId, fillColor, strokeColor, strokeWeight, }); const typedResult = result as { id: string, name: string }; return { content: [ { type: "text", text: `Created ellipse with ID: ${typedResult.id}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error creating ellipse: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- Input schema using Zod for validating parameters like position, dimensions, colors for the create_ellipse tool.{ x: z.number().describe("X position"), y: z.number().describe("Y position"), width: z.number().describe("Width of the ellipse"), height: z.number().describe("Height of the ellipse"), name: z.string().optional().describe("Optional name for the ellipse"), parentId: z.string().optional().describe("Optional parent node ID to append the ellipse to"), fillColor: z .object({ r: z.number().min(0).max(1).describe("Red component (0-1)"), g: z.number().min(0).max(1).describe("Green component (0-1)"), b: z.number().min(0).max(1).describe("Blue component (0-1)"), a: z.number().min(0).max(1).optional().describe("Alpha component (0-1)"), }) .optional() .describe("Fill color in RGBA format"), strokeColor: z .object({ r: z.number().min(0).max(1).describe("Red component (0-1)"), g: z.number().min(0).max(1).describe("Green component (0-1)"), b: z.number().min(0).max(1).describe("Blue component (0-1)"), a: z.number().min(0).max(1).optional().describe("Alpha component (0-1)"), }) .optional() .describe("Stroke color in RGBA format"), strokeWeight: z.number().positive().optional().describe("Stroke weight"), },
- The async handler function that implements the tool logic: calls sendCommandToFigma with 'create_ellipse' command and parameters, handles response or error, returns markdown content.async ({ x, y, width, height, name, parentId, fillColor, strokeColor, strokeWeight }) => { try { const result = await sendCommandToFigma("create_ellipse", { x, y, width, height, name: name || "Ellipse", parentId, fillColor, strokeColor, strokeWeight, }); const typedResult = result as { id: string, name: string }; return { content: [ { type: "text", text: `Created ellipse with ID: ${typedResult.id}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error creating ellipse: ${error instanceof Error ? error.message : String(error)}` } ] }; }
- Part of FigmaCommand type union, used for typing the commands sent to Figma plugin, including 'create_ellipse'.| "create_ellipse"
- src/talk_to_figma_mcp/tools/index.ts:15-15 (registration)Higher-level registration call that invokes registerCreationTools, which includes create_ellipse.registerCreationTools(server);