Skip to main content
Glama

create_text

Add text elements to Figma designs with precise positioning, styling, and formatting options for labels, annotations, and interface text.

Instructions

Create a new text element in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX position
yYesY position
textYesText content
fontSizeNoFont size (default: 14)
fontWeightNoFont weight (e.g., 400 for Regular, 700 for Bold)
fontColorNoFont color in RGBA format
nameNoOptional name for the text node by default following text
parentIdNoOptional parent node ID to append the text to

Implementation Reference

  • Core registration of the 'create_text' MCP tool, including description, Zod input schema (positions, text, styling options), and handler logic that forwards to Figma's websocket command with defaults and returns structured response.
    server.tool(
      "create_text",
      "Create a new text element in Figma",
      {
        x: z.number().describe("X position"),
        y: z.number().describe("Y position"),
        text: z.string().describe("Text content"),
        fontSize: z.number().optional().describe("Font size (default: 14)"),
        fontWeight: z
          .number()
          .optional()
          .describe("Font weight (e.g., 400 for Regular, 700 for Bold)"),
        fontColor: 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("Font color in RGBA format"),
        name: z
          .string()
          .optional()
          .describe("Optional name for the text node by default following text"),
        parentId: z
          .string()
          .optional()
          .describe("Optional parent node ID to append the text to"),
      },
      async ({ x, y, text, fontSize, fontWeight, fontColor, name, parentId }) => {
        try {
          const result = await sendCommandToFigma("create_text", {
            x,
            y,
            text,
            fontSize: fontSize || 14,
            fontWeight: fontWeight || 400,
            fontColor: fontColor || { r: 0, g: 0, b: 0, a: 1 },
            name: name || "Text",
            parentId,
          });
          const typedResult = result as { name: string; id: string };
          return {
            content: [
              {
                type: "text",
                text: `Created text "${typedResult.name}" with ID: ${typedResult.id}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error creating text: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Intermediate registration call to registerCreationTools which includes the create_text tool.
    registerCreationTools(server);
  • Top-level registration call to registerTools aggregator which includes creation tools containing create_text.
    registerTools(server);
  • Type definition for FigmaCommand union including 'create_text' used in websocket communications.
    | "create_text"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'creates' a new element, implying a write/mutation operation, but doesn't cover important aspects like whether this requires specific permissions, if it's idempotent, what happens on failure, or the format of the response (e.g., returns a node ID). This leaves significant gaps for an agent to understand the tool's behavior.

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, clear sentence that directly states the tool's purpose without any wasted words. It's front-loaded with the essential information ('Create a new text element in Figma'), making it highly efficient and easy to parse.

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?

Given the complexity (8 parameters, mutation operation, no output schema, and no annotations), the description is insufficient. It doesn't explain what the tool returns (e.g., a node ID or success status), potential side effects, error conditions, or how it interacts with other tools. For a creation tool in a design environment, more context is needed for effective use.

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?

The description adds no parameter information beyond what's already in the input schema, which has 100% coverage with detailed descriptions for all 8 parameters. The baseline score of 3 is appropriate since the schema fully documents parameters like position coordinates, text content, and styling options, making additional description unnecessary for semantics.

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 text element in Figma'), making the purpose immediately understandable. It distinguishes this as a creation tool among siblings like 'set_text_content' or 'get_node_info', though it doesn't explicitly differentiate from other creation tools like 'create_rectangle' or 'create_frame' beyond the resource type.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention when to choose 'create_text' over 'set_text_content' (which modifies existing text) or other creation tools for different element types. The description lacks context about prerequisites, such as needing an active Figma document or specific permissions.

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