Skip to main content
Glama
andreycretsu

Cursor Talk to Figma MCP

by andreycretsu

set_item_spacing

Adjust spacing between elements in auto-layout frames to create consistent visual hierarchy and improve design alignment.

Instructions

Set distance between children in an auto-layout frame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the frame to modify
itemSpacingYesDistance between children. Note: This value will be ignored if primaryAxisAlignItems is set to SPACE_BETWEEN.

Implementation Reference

  • MCP server.tool registration, input schema (Zod), and handler function for the 'set_item_spacing' tool. The handler proxies the parameters to a Figma plugin command via sendCommandToFigma and formats the response.
    server.tool(
      "set_item_spacing",
      "Set distance between children in an auto-layout frame",
      {
        nodeId: z.string().describe("The ID of the frame to modify"),
        itemSpacing: z.number().describe("Distance between children. Note: This value will be ignored if primaryAxisAlignItems is set to SPACE_BETWEEN.")
      },
      async ({ nodeId, itemSpacing }) => {
        try {
          const result = await sendCommandToFigma("set_item_spacing", {
            nodeId,
            itemSpacing
          });
          const typedResult = result as { name: string };
    
          return {
            content: [
              {
                type: "text",
                text: `Set item spacing to ${itemSpacing} for frame "${typedResult.name}"`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting item spacing: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The 'set_item_spacing' command is included in the FigmaCommand type union, confirming it's a recognized Figma plugin command proxied by this MCP tool.
    | "set_item_spacing"
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. It states the tool modifies a frame (implying mutation) but doesn't disclose permission requirements, whether changes are reversible, rate limits, or what happens if the frame isn't auto-layout. The description mentions the itemSpacing parameter's limitation with SPACE_BETWEEN alignment, which adds some behavioral context, but overall coverage is minimal 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 directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool with two parameters and front-loads the core functionality. Every word earns its place with zero waste.

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

Completeness3/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 minimally adequate. It covers the basic purpose but lacks behavioral context, error conditions, and relationship to other layout tools. The 100% schema coverage helps with parameters, but overall completeness is limited given the tool's potential complexity in a design system context.

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%, providing complete parameter documentation. The description adds no additional parameter semantics beyond what's in the schema. It mentions 'distance between children' which echoes the schema's 'itemSpacing' description, but doesn't clarify units, valid ranges, or edge cases. With high schema coverage, the baseline score of 3 is appropriate.

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 ('Set distance') and target ('children in an auto-layout frame'), providing a specific verb+resource combination. It distinguishes from siblings like 'set_padding' or 'set_layout_mode' by focusing specifically on child spacing. However, it doesn't explicitly differentiate from all potential layout-related tools beyond the auto-layout context.

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. It doesn't mention prerequisites (e.g., needing an auto-layout frame), when-not-to-use scenarios, or how it relates to sibling tools like 'set_layout_sizing' or 'set_padding'. The agent must infer usage from the description alone without explicit direction.

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