Skip to main content
Glama
paragdesai1

Cursor Talk to Figma MCP

by paragdesai1

set_item_spacing

Adjust spacing between elements in a Figma auto-layout frame to control visual hierarchy and alignment in designs.

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 tool registration, schema, and handler for 'set_item_spacing'. The handler proxies the command to the Figma plugin via sendCommandToFigma, which sends it over websocket, 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)}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool modifies a frame, implying a mutation, but does not address permissions, side effects, error conditions, or response format. The description is minimal and fails to provide essential behavioral context beyond the basic action.

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, direct sentence that efficiently conveys the tool's purpose without unnecessary words. It is front-loaded with the core action and target, making it easy to understand at a glance, and there is no wasted verbiage or redundant 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?

Given the lack of annotations and output schema, the description is incomplete for a mutation tool. It does not explain what happens on success or failure, potential side effects, or how it interacts with other layout properties. For a tool that modifies visual elements, more context is needed to ensure safe and correct usage by an AI agent.

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 clear descriptions for both parameters in the input schema. The description does not add any additional meaning or context beyond what the schema provides, such as units for 'itemSpacing' or examples of valid 'nodeId' formats. However, with high schema coverage, a baseline score of 3 is appropriate as the schema adequately documents the parameters.

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 ('between children in an auto-layout frame'), which is specific and unambiguous. However, it does not explicitly differentiate from sibling tools like 'set_layout_mode' or 'set_layout_sizing', which also affect layout properties, leaving some room for confusion about when to choose this tool over those alternatives.

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, such as other layout-related tools like 'set_layout_mode' or 'set_axis_align'. It lacks context about prerequisites, dependencies, or scenarios where this tool is appropriate, offering only a basic functional statement without usage instructions.

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/paragdesai1/parag-Figma-MCP'

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