Skip to main content
Glama

create_star

Add a customizable star shape to Figma designs by specifying position, size, points, colors, and other properties for precise graphic creation.

Instructions

Create a new star in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX position
yYesY position
widthYesWidth of the star
heightYesHeight of the star
pointsNoNumber of points (default: 5)
innerRadiusNoInner radius ratio (0.01-0.99, default: 0.5)
nameNoOptional name for the star
parentIdNoOptional parent node ID to append the star to
fillColorNoFill color in RGBA format
strokeColorNoStroke color in RGBA format
strokeWeightNoStroke weight

Implementation Reference

  • The handler function that implements the core logic for the 'create_star' tool. It sends a 'create_star' command to Figma using sendCommandToFigma with parameters like position, size, points, inner radius, colors, etc., and returns a formatted response with the created star's ID or an error message.
        try {
          const result = await sendCommandToFigma("create_star", {
            x,
            y,
            width,
            height,
            points: points || 5,
            innerRadius: innerRadius || 0.5,
            name: name || "Star",
            parentId,
            fillColor,
            strokeColor,
            strokeWeight,
          });
          
          const typedResult = result as { id: string, name: string };
          return {
            content: [
              {
                type: "text",
                text: `Created star with ID: ${typedResult.id}, ${points || 5} points, and inner radius ratio of ${innerRadius || 0.5}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error creating star: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Zod input schema for the 'create_star' tool, validating parameters such as position (x,y), dimensions (width, height), star properties (points, innerRadius), name, parentId, and styling (fillColor, strokeColor, strokeWeight).
      x: z.number().describe("X position"),
      y: z.number().describe("Y position"),
      width: z.number().describe("Width of the star"),
      height: z.number().describe("Height of the star"),
      points: z.number().min(3).optional().describe("Number of points (default: 5)"),
      innerRadius: z.number().min(0.01).max(0.99).optional().describe("Inner radius ratio (0.01-0.99, default: 0.5)"),
      name: z.string().optional().describe("Optional name for the star"),
      parentId: z.string().optional().describe("Optional parent node ID to append the star 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, points, innerRadius, name, parentId, fillColor, strokeColor, strokeWeight }) => {
  • The MCP server.tool() call that registers the 'create_star' tool, specifying its name, description, input schema, and handler function.
    server.tool(
      "create_star",
      "Create a new star in Figma",
      {
        x: z.number().describe("X position"),
        y: z.number().describe("Y position"),
        width: z.number().describe("Width of the star"),
        height: z.number().describe("Height of the star"),
        points: z.number().min(3).optional().describe("Number of points (default: 5)"),
        innerRadius: z.number().min(0.01).max(0.99).optional().describe("Inner radius ratio (0.01-0.99, default: 0.5)"),
        name: z.string().optional().describe("Optional name for the star"),
        parentId: z.string().optional().describe("Optional parent node ID to append the star 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, points, innerRadius, name, parentId, fillColor, strokeColor, strokeWeight }) => {
        try {
          const result = await sendCommandToFigma("create_star", {
            x,
            y,
            width,
            height,
            points: points || 5,
            innerRadius: innerRadius || 0.5,
            name: name || "Star",
            parentId,
            fillColor,
            strokeColor,
            strokeWeight,
          });
          
          const typedResult = result as { id: string, name: string };
          return {
            content: [
              {
                type: "text",
                text: `Created star with ID: ${typedResult.id}, ${points || 5} points, and inner radius ratio of ${innerRadius || 0.5}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error creating star: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Call to registerCreationTools(server) within registerTools, which includes registration of the create_star tool.
    registerCreationTools(server);
  • TypeScript union type FigmaCommand that includes 'create_star' as one of the supported Figma commands used by the tool handler.
    export type FigmaCommand =
      | "get_document_info"
      | "get_selection"
      | "get_node_info"
      | "create_rectangle"
      | "create_frame"
      | "create_text"
      | "create_ellipse"
      | "create_polygon"
      | "create_star"
      | "create_vector"
      | "create_line"
      | "set_fill_color"
      | "set_stroke_color"
      | "move_node"
      | "resize_node"
      | "delete_node"
      | "get_styles"
      | "get_local_components"
      | "get_team_components"
      | "create_component_instance"
      | "export_node_as_image"
      | "join"
      | "set_corner_radius"
      | "clone_node"
      | "set_text_content"
      | "scan_text_nodes"
      | "set_multiple_text_contents"
      | "set_auto_layout"
      | "set_font_name"
      | "set_font_size"
      | "set_font_weight"
      | "set_letter_spacing"
      | "set_line_height"
      | "set_paragraph_spacing"
      | "set_text_case"
      | "set_text_decoration"
      | "get_styled_text_segments"
      | "load_font_async"
      | "get_remote_components"
      | "set_effects"
      | "set_effect_style_id"
      | "group_nodes"
      | "ungroup_nodes"
      | "flatten_node"
      | "insert_child";
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create' implies a write/mutation operation, but the description doesn't mention permissions needed, whether the star becomes part of the document immediately, error conditions, or what happens on success/failure. For a creation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex creation tool with 11 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after creation (e.g., returns the new star's ID), error handling, or how the star integrates with the Figma document. The description should provide more context about the tool's behavior and outcomes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema descriptions. According to guidelines, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('new star in Figma'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling shape creation tools like create_ellipse, create_polygon, or create_rectangle, which would require mentioning what makes a star distinct (e.g., points, inner radius).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With multiple shape creation siblings (ellipse, polygon, rectangle, etc.), there's no indication of when a star is appropriate versus other shapes, nor any prerequisites or context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/agenisea/cc-fig-mcp'

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