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);
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 doesn't clarify permissions needed, whether changes are reversible, error conditions (e.g., invalid nodeId), or side effects. For a mutation tool with zero annotation coverage, this lack of behavioral detail is a significant gap.

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 action and target without unnecessary words. It avoids redundancy with the tool name or schema, making it highly concise and well-structured for quick comprehension.

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 tool's mutation nature, lack of annotations, and absence of an output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, response format, or integration with sibling tools (e.g., 'get_node_info' for nodeId retrieval). For a tool that modifies resources in a design platform, more context is needed to ensure safe and effective use.

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 (nodeId and fontSize). The description adds no additional semantic context beyond what the schema provides, such as examples or constraints (e.g., typical font size ranges in Figma). With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 ('font size of a text node in Figma'), making the purpose immediately understandable. It distinguishes from siblings like 'set_font_name' or 'set_font_weight' by focusing specifically on size. However, it doesn't explicitly mention the platform context (Figma) as a differentiator from potential non-Figma tools, which keeps it from a perfect 5.

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 siblings like 'set_text_style_id' that might affect font size indirectly. Without such context, the agent must infer usage solely from the tool name and parameters.

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