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> {

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.2
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed5 schema fields changedv1.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / family
      Added value: +{
      +  "description": "Font family name",
      +  "type": "string"
      +}
    • addedInput schema / properties / nodeId
      Added value: +{
      +  "description": "The ID of the text node to modify",
      +  "type": "string"
      +}
    • addedInput schema / properties / style
      Added value: +{
      +  "description": "Font style (e.g., 'Regular', 'Bold', 'Italic')",
      +  "type": "string"
      +}
    • addedInput schema / required
      Added value: +[
      +  "nodeId",
      +  "family"
      +]
  3. First observed

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 must convey behavioral traits. It only states the action (set font name and style) but does not disclose side effects like font loading requirements, whether the operation is idempotent, or what happens if the font is unavailable. The mutation implication is clear, but richer behavioral context is missing.

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 sentence of 13 words that immediately conveys the core purpose. Every word earns its place; there is no fluff or redundancy. It is front-loaded with the action and target. For a simple tool, this is appropriately concise.

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 simplicity and full schema coverage, the description is minimally adequate. However, it lacks behavioral context (e.g., font loading, error conditions) and does not explain the return value (no output schema). For a mutation tool with no annotations, more detail would improve completeness, especially regarding prerequisites like node type validation.

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%, so the baseline is 3. The description adds no additional meaning beyond the schema's parameter descriptions (e.g., family is 'Font family name'). It does not clarify parameter dependencies, valid values, or how style interacts with family. The description neither improves nor harms parameter understanding.

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 tool sets font name and style on a text node in Figma. It specifies the action and resource, though it does not explicitly differentiate from siblings like set_font_size or set_font_weight. The verb 'set' combined with 'font name and style' is specific enough to avoid confusion.

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, such as set_text_style_id or individual font property setters. There are no prerequisites, when-not-to-use instructions, or mention of related tools. The agent must infer usage from the name alone.

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

Deploy Server

Other Tools