Skip to main content
Glama

set_paragraph_spacing

Adjust paragraph spacing in Figma text nodes to control vertical spacing between paragraphs for improved readability and layout design.

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

  • The handler function that executes the set_paragraph_spacing tool logic by sending the command to Figma via websocket and returning formatted success or error response.
      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)}`
              }
            ]
          };
        }
      }
    );
  • Input schema using Zod for validating nodeId (string) and paragraphSpacing (number) parameters.
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      paragraphSpacing: z.number().describe("Paragraph spacing value in pixels"),
    },
  • Registers the set_paragraph_spacing tool on the MCP server with description, input schema, and handler function.
    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)}`
              }
            ]
          };
        }
      }
    );
  • Calls registerTextTools which includes the registration of set_paragraph_spacing among other text tools.
    registerTextTools(server);
  • Top-level call to registerTools which triggers registration of all tools including set_paragraph_spacing.
    registerTools(server);
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 text node, implying a mutation, but does not address critical aspects like whether changes are reversible, permission requirements, error handling, or side effects. This leaves significant gaps in understanding 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, direct sentence that efficiently conveys the core purpose without unnecessary words. It is front-loaded with the key action and target, making it easy to parse quickly, which is ideal for conciseness.

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 fails to explain what the tool returns, error conditions, or behavioral nuances, leaving the agent with insufficient context to use it effectively beyond basic parameter input.

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 input schema has 100% description coverage, clearly documenting both parameters ('nodeId' and 'paragraphSpacing'). The description adds no additional semantic details beyond what the schema provides, such as units clarification or valid ranges, so it meets the baseline for high schema coverage without extra value.

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 the target ('paragraph spacing of a text node in Figma'), making the purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'set_line_height' or 'set_letter_spacing', which also modify text node properties, leaving some ambiguity in sibling distinction.

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 text formatting tools in the sibling list. It lacks context about prerequisites, like needing a valid text node ID, or exclusions, such as not applying to non-text nodes, which could lead to misuse.

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/agenisea/cc-fig-mcp'

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