Skip to main content
Glama

set_font_name

Change the font family and style for text elements in Figma designs by specifying the node ID and desired typography.

Instructions

Set the font name and style of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
familyYesFont family name
styleNoFont style (e.g., 'Regular', 'Bold', 'Italic')

Implementation Reference

  • Registers the 'set_font_name' MCP tool on the server, defining its description, input schema (nodeId, family, style), and handler function that forwards the command to Figma via websocket and formats the response.
    server.tool(
      "set_font_name",
      "Set the font name and style of a text node in Figma",
      {
        nodeId: z.string().describe("The ID of the text node to modify"),
        family: z.string().describe("Font family name"),
        style: z.string().optional().describe("Font style (e.g., 'Regular', 'Bold', 'Italic')"),
      },
      async ({ nodeId, family, style }) => {
        try {
          const result = await sendCommandToFigma("set_font_name", {
            nodeId,
            family,
            style
          });
          const typedResult = result as { name: string, fontName: { family: string, style: string } };
          return {
            content: [
              {
                type: "text",
                text: `Updated font of node "${typedResult.name}" to ${typedResult.fontName.family} ${typedResult.fontName.style}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting font name: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • The core handler logic for the 'set_font_name' tool: sends the command to Figma, type-casts the result, and returns a formatted text response or error.
    async ({ nodeId, family, style }) => {
      try {
        const result = await sendCommandToFigma("set_font_name", {
          nodeId,
          family,
          style
        });
        const typedResult = result as { name: string, fontName: { family: string, style: string } };
        return {
          content: [
            {
              type: "text",
              text: `Updated font of node "${typedResult.name}" to ${typedResult.fontName.family} ${typedResult.fontName.style}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting font name: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema for input parameters: nodeId (string), family (string), style (optional string).
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      family: z.string().describe("Font family name"),
      style: z.string().optional().describe("Font style (e.g., 'Regular', 'Bold', 'Italic')"),
    },
  • Type definition including 'set_font_name' in the FigmaCommand union type for internal command validation.
    | "set_font_name"
  • Calls registerTextTools which includes registration of 'set_font_name' tool.
    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. While 'Set' implies a mutation, the description doesn't specify whether this requires specific permissions, if changes are reversible, potential side effects (e.g., affecting text layout), or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 any wasted words. It directly communicates the tool's purpose in a structured manner, making it easy for an agent to parse and understand quickly.

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 that this is a mutation tool with no annotations and no output schema, the description is incomplete. It fails to address behavioral aspects like error handling, permissions, or what the tool returns (e.g., success confirmation or updated node details). For a tool that modifies resources, more contextual information is needed to guide 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?

The schema description coverage is 100%, with clear descriptions for all three parameters ('nodeId', 'family', 'style'). The description adds no additional parameter semantics beyond what the schema already provides, such as format examples or constraints. However, since the schema does the heavy lifting, a 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 target ('font name and style of a text node in Figma'), making the purpose immediately understandable. It distinguishes itself from sibling tools like 'set_font_size' or 'set_font_weight' by focusing specifically on font family and style. However, it doesn't explicitly contrast with all similar tools (e.g., 'set_text_style_id'), which prevents a perfect 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 like 'set_text_style_id' or 'set_font_weight', nor does it mention prerequisites such as needing a valid text node ID. It lacks context about when this tool is appropriate compared to other font-related tools in the sibling list, leaving the agent without usage direction.

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