Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

set_paragraph_spacing

Adjust spacing between paragraphs in Figma text nodes to improve readability and visual hierarchy in designs.

Instructions

Set the paragraph spacing of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
paragraphSpacingYesParagraph spacing value in pixels

Implementation Reference

  • Registers the MCP tool 'set_paragraph_spacing' including its description, Zod input schema (nodeId: string, paragraphSpacing: number), and async handler. The handler sends the command to the Figma plugin via sendCommandToFigma and returns a formatted success or error message.
    // Set Paragraph Spacing Tool
    server.tool(
      "set_paragraph_spacing",
      "Set the paragraph spacing of a text node in Figma",
      {
        nodeId: z.string().describe("The ID of the text node to modify"),
        paragraphSpacing: z.number().describe("Paragraph spacing value in pixels"),
      },
      async ({ nodeId, paragraphSpacing }) => {
        try {
          const result = await sendCommandToFigma("set_paragraph_spacing", {
            nodeId,
            paragraphSpacing
          });
          const typedResult = result as { name: string, paragraphSpacing: number };
          return {
            content: [
              {
                type: "text",
                text: `Updated paragraph spacing of node "${typedResult.name}" to ${typedResult.paragraphSpacing}px`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting paragraph spacing: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • The core handler logic for executing the 'set_paragraph_spacing' tool: calls sendCommandToFigma with parameters, type-casts the result, and returns content with update confirmation or error.
    async ({ nodeId, paragraphSpacing }) => {
      try {
        const result = await sendCommandToFigma("set_paragraph_spacing", {
          nodeId,
          paragraphSpacing
        });
        const typedResult = result as { name: string, paragraphSpacing: number };
        return {
          content: [
            {
              type: "text",
              text: `Updated paragraph spacing of node "${typedResult.name}" to ${typedResult.paragraphSpacing}px`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting paragraph spacing: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema defining inputs for the tool: nodeId (string) and paragraphSpacing (number).
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      paragraphSpacing: z.number().describe("Paragraph spacing value in pixels"),
    },
  • Includes 'set_paragraph_spacing' in the FigmaCommand type union, used internally for typing the commands sent to Figma plugin.
    | "set_paragraph_spacing"
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 this is a modification tool ('Set'), implying mutation, but doesn't describe what happens (e.g., whether changes are reversible, if it requires specific permissions, or error conditions). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its 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, efficient sentence that states the tool's purpose without any wasted words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence earns its place by conveying essential information.

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?

Given the tool's moderate complexity (2 required parameters, mutation operation) and lack of annotations or output schema, the description is minimally adequate. It explains what the tool does but doesn't cover behavioral aspects, usage context, or return values. For a mutation tool, this leaves the agent with incomplete guidance, though the clear purpose and schema help somewhat.

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 both parameters ('nodeId' and 'paragraphSpacing') clearly documented in the schema. The description adds no additional parameter semantics beyond what's in the schema (e.g., no examples or units clarification). According to the rules, when schema coverage is high (>80%), the baseline score is 3 even without 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 ('Set') and target resource ('paragraph spacing of a text node in Figma'), making the purpose immediately understandable. It distinguishes itself from siblings like 'set_line_height' or 'set_font_size' by focusing specifically on paragraph spacing. However, it doesn't explicitly contrast with all sibling tools, so it doesn't reach the highest score.

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 a text node), exclusions (e.g., not applicable to non-text nodes), or related tools like 'set_line_height' for similar text formatting. The agent must infer usage from the tool name and parameters alone.

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/arinspunk/claude-talk-to-figma-mcp'

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