Skip to main content
Glama

set_font_size

Adjust text font size in Figma by specifying the node ID and pixel value to modify design elements through the CC Fig MCP server.

Instructions

Set the font size of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
fontSizeYesFont size in pixels

Implementation Reference

  • The handler function that implements the core logic of the set_font_size tool: sends the command to Figma via websocket, processes the response, and returns a success or error message.
    async ({ nodeId, fontSize }) => {
      try {
        const result = await sendCommandToFigma("set_font_size", {
          nodeId,
          fontSize
        });
        const typedResult = result as { name: string, fontSize: number };
        return {
          content: [
            {
              type: "text",
              text: `Updated font size of node "${typedResult.name}" to ${typedResult.fontSize}px`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting font size: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema defining the input parameters for the tool: nodeId (string) and fontSize (positive number).
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      fontSize: z.number().positive().describe("Font size in pixels"),
    },
  • The server.tool() registration call that defines and registers the set_font_size MCP tool, including its name, description, input schema, and handler function.
    server.tool(
      "set_font_size",
      "Set the font size of a text node in Figma",
      {
        nodeId: z.string().describe("The ID of the text node to modify"),
        fontSize: z.number().positive().describe("Font size in pixels"),
      },
      async ({ nodeId, fontSize }) => {
        try {
          const result = await sendCommandToFigma("set_font_size", {
            nodeId,
            fontSize
          });
          const typedResult = result as { name: string, fontSize: number };
          return {
            content: [
              {
                type: "text",
                text: `Updated font size of node "${typedResult.name}" to ${typedResult.fontSize}px`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting font size: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Higher-level registration call to registerTextTools(server), which includes the set_font_size tool among other text tools.
    registerTextTools(server);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
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. While 'Set' implies a mutation operation, the description doesn't specify whether this requires specific permissions, what happens if the nodeId is invalid, if changes are reversible, or if there are rate limits. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 unnecessary words. Every part of the sentence ('Set the font size of a text node in Figma') directly contributes to understanding the tool's function, making it optimally concise and well-structured.

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 (a mutation operation with 2 parameters), no annotations, and no output schema, the description is minimally adequate but incomplete. It states what the tool does but lacks behavioral context, usage guidelines, and output information. The high schema coverage helps, but the description doesn't fully compensate for the missing annotations and output schema.

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 schema description coverage is 100%, with both parameters (nodeId and fontSize) clearly documented in the schema. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain what a 'text node' is or provide context for valid fontSize ranges). 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') and the target resource ('font size of a text node in Figma'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from similar sibling tools like 'set_font_name', 'set_font_weight', or 'set_text_content', which all modify text properties. The description is specific but lacks sibling differentiation.

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 ID), exclusions (e.g., not applicable to non-text nodes), or comparisons to sibling tools like 'set_font_name' or 'set_text_content'. The agent must infer usage from the tool name and schema alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.