Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

set_text_content

Modify text content in Figma design files by updating existing text nodes with new text values using node IDs.

Instructions

Set the text content of an existing text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
textYesNew text content

Implementation Reference

  • The async handler that implements the core logic of the set_text_content tool by sending the command to Figma via websocket and formatting the response.
    async ({ nodeId, text }) => {
      try {
        const result = await sendCommandToFigma("set_text_content", {
          nodeId,
          text,
        });
        const typedResult = result as { name: string };
        return {
          content: [
            {
              type: "text",
              text: `Updated text content of node "${typedResult.name}" to "${text}"`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting text content: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Registers the set_text_content MCP tool, including name, description, input schema, and references the handler function.
    server.tool(
      "set_text_content",
      "Set the text content of an existing text node in Figma",
      {
        nodeId: z.string().describe("The ID of the text node to modify"),
        text: z.string().describe("New text content"),
      },
      async ({ nodeId, text }) => {
        try {
          const result = await sendCommandToFigma("set_text_content", {
            nodeId,
            text,
          });
          const typedResult = result as { name: string };
          return {
            content: [
              {
                type: "text",
                text: `Updated text content of node "${typedResult.name}" to "${text}"`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting text content: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • Zod schema defining input parameters for the tool: nodeId (string) and text (string).
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      text: z.string().describe("New text content"),
    },
  • Calls registerTextTools to include text tools (including set_text_content) in the overall tool registration.
    registerTextTools(server);
  • Type definition including set_text_content in FigmaCommand union type.
    | "set_text_content"
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. It states this is a mutation tool ('Set'), but does not disclose behavioral traits such as permissions required, whether changes are reversible, error handling (e.g., if nodeId is invalid), or rate limits. This is a significant gap for a mutation tool with zero annotation coverage.

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 with zero waste—it directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded for clarity.

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 this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits (e.g., side effects, error responses) and does not explain return values, which is inadequate for a tool that modifies resources.

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 schema already documents both parameters (nodeId and text). The description adds no additional meaning beyond what the schema provides, such as format examples or constraints (e.g., text length limits). Baseline 3 is appropriate when schema does the heavy lifting.

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 the specific action ('Set the text content') and target resource ('an existing text node in Figma'), distinguishing it from sibling tools like 'create_text' (which creates new text) and 'set_multiple_text_contents' (which modifies multiple nodes).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying 'an existing text node,' suggesting it should not be used for creating new text nodes (use 'create_text' instead). However, it does not explicitly state when to use alternatives like 'set_multiple_text_contents' or mention prerequisites (e.g., node must be a text node).

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