Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

set_font_name

Assign a font family and style to a Figma text node. Specify the node ID and family name; optionally include a style such as Bold or Italic.

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

  • Tool handler for 'set_font_name'. Defines the MCP tool with input schema (nodeId, family, optional style), calls sendCommandToFigma with the 'set_font_name' command, and returns success/error messages.
    // Set Font Name Tool
    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)}`
              }
            ]
          };
        }
      }
    );
  • Registration function that registers the set_font_name tool (along with other text tools) on the MCP server via server.tool().
    export function registerTextTools(server: McpServer): void {
  • Type definition for FigmaCommand union type, includes 'set_font_name' as a valid command value.
    | "set_font_name"
  • Helper function that sends a command (including 'set_font_name') to Figma via WebSocket, used by the tool handler.
    export function sendCommandToFigma(
      command: FigmaCommand,
      params: unknown = {},
      timeoutMs: number = 300000
    ): Promise<unknown> {
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are available, so the description must disclose behavioral traits. It only says 'set' without explaining side effects (e.g., requiring font to be loaded, affecting entire text, causing reflow). The minimal description fails to inform the agent about mutation risks.

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, complete sentence with no redundant information. It is appropriately front-loaded and concise.

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?

For a tool with no annotations and moderate complexity (3 params, no output schema), the description is insufficient. It omits critical context such as font loading requirements, error scenarios, and behavior when the font is unavailable or the style is omitted.

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 already provides full descriptions for all 3 parameters (100% coverage), so the tool description adds little extra meaning. The phrase 'font name and style' reinforces the purpose but does not clarify format or constraints beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Set the font name and style of a text node in Figma', specifying the action (set), resource (font name and style), and target (text node). It effectively distinguishes from sibling tools like set_font_size or set_font_weight that modify only a single attribute.

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?

No guidance is provided on when to use this tool versus alternatives (e.g., set_font_size, set_font_weight). The description does not mention optionality of style or prerequisites like font loading, leaving the agent without decision context.

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