Skip to main content
Glama
andreycretsu

Cursor Talk to Figma MCP

by andreycretsu

set_axis_align

Adjust auto-layout frame alignment in Figma by setting primary and counter axis positioning for precise design arrangement.

Instructions

Set primary and counter axis alignment for an auto-layout frame in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the frame to modify
primaryAxisAlignItemsNoPrimary axis alignment (MIN/MAX = left/right in horizontal, top/bottom in vertical). Note: When set to SPACE_BETWEEN, itemSpacing will be ignored as children will be evenly spaced.
counterAxisAlignItemsNoCounter axis alignment (MIN/MAX = top/bottom in horizontal, left/right in vertical)

Implementation Reference

  • MCP tool registration for 'set_axis_align', including schema definition and handler implementation that forwards the command to the Figma plugin.
    server.tool(
      "set_axis_align",
      "Set primary and counter axis alignment for an auto-layout frame in Figma",
      {
        nodeId: z.string().describe("The ID of the frame to modify"),
        primaryAxisAlignItems: z
          .enum(["MIN", "MAX", "CENTER", "SPACE_BETWEEN"])
          .optional()
          .describe("Primary axis alignment (MIN/MAX = left/right in horizontal, top/bottom in vertical). Note: When set to SPACE_BETWEEN, itemSpacing will be ignored as children will be evenly spaced."),
        counterAxisAlignItems: z
          .enum(["MIN", "MAX", "CENTER", "BASELINE"])
          .optional()
          .describe("Counter axis alignment (MIN/MAX = top/bottom in horizontal, left/right in vertical)")
      },
      async ({ nodeId, primaryAxisAlignItems, counterAxisAlignItems }) => {
        try {
          const result = await sendCommandToFigma("set_axis_align", {
            nodeId,
            primaryAxisAlignItems,
            counterAxisAlignItems
          });
          const typedResult = result as { name: string };
    
          // Create a message about which alignments were set
          const alignMessages = [];
          if (primaryAxisAlignItems !== undefined) alignMessages.push(`primary: ${primaryAxisAlignItems}`);
          if (counterAxisAlignItems !== undefined) alignMessages.push(`counter: ${counterAxisAlignItems}`);
    
          const alignText = alignMessages.length > 0
            ? `axis alignment (${alignMessages.join(', ')})`
            : "axis alignment";
    
          return {
            content: [
              {
                type: "text",
                text: `Set ${alignText} for frame "${typedResult.name}"`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting axis alignment: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Input schema using Zod for validating parameters: nodeId (required), primaryAxisAlignItems and counterAxisAlignItems (optional enums).
      nodeId: z.string().describe("The ID of the frame to modify"),
      primaryAxisAlignItems: z
        .enum(["MIN", "MAX", "CENTER", "SPACE_BETWEEN"])
        .optional()
        .describe("Primary axis alignment (MIN/MAX = left/right in horizontal, top/bottom in vertical). Note: When set to SPACE_BETWEEN, itemSpacing will be ignored as children will be evenly spaced."),
      counterAxisAlignItems: z
        .enum(["MIN", "MAX", "CENTER", "BASELINE"])
        .optional()
        .describe("Counter axis alignment (MIN/MAX = top/bottom in horizontal, left/right in vertical)")
    },
  • Handler function that invokes the Figma plugin command 'set_axis_align' with the provided nodeId and alignment parameters, then formats a success or error response.
    async ({ nodeId, primaryAxisAlignItems, counterAxisAlignItems }) => {
      try {
        const result = await sendCommandToFigma("set_axis_align", {
          nodeId,
          primaryAxisAlignItems,
          counterAxisAlignItems
        });
        const typedResult = result as { name: string };
    
        // Create a message about which alignments were set
        const alignMessages = [];
        if (primaryAxisAlignItems !== undefined) alignMessages.push(`primary: ${primaryAxisAlignItems}`);
        if (counterAxisAlignItems !== undefined) alignMessages.push(`counter: ${counterAxisAlignItems}`);
    
        const alignText = alignMessages.length > 0
          ? `axis alignment (${alignMessages.join(', ')})`
          : "axis alignment";
    
        return {
          content: [
            {
              type: "text",
              text: `Set ${alignText} for frame "${typedResult.name}"`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting axis alignment: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a 'Set' operation (implying mutation) but doesn't disclose behavioral traits like whether changes are reversible, permission requirements, error conditions, or what happens if applied to non-auto-layout frames. The description is minimal and lacks crucial context for a mutation tool.

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 front-loads the core purpose without any wasted words. It directly communicates the tool's function in a compact form.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects (e.g., side effects, error handling) or provide usage context. While the schema covers parameters well, the overall tool context lacks necessary disclosure for safe and 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?

Schema description coverage is 100%, with detailed parameter descriptions already in the schema (e.g., explaining MIN/MAX mappings and SPACE_BETWEEN behavior). The tool description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Set') and target resource ('primary and counter axis alignment for an auto-layout frame in Figma'). It distinguishes this from sibling tools like set_item_spacing or set_layout_mode by specifying the exact alignment properties being modified.

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. While it mentions 'auto-layout frame', it doesn't specify prerequisites (e.g., the frame must already have auto-layout enabled) or contrast with similar tools like set_layout_mode that might affect related properties.

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/andreycretsu/cursor-talk-to-figma-mcp-main'

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