Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

set_text_decoration

Apply text decoration to Figma text nodes by setting underline, strikethrough, or no decoration using node ID and decoration type parameters.

Instructions

Set the text decoration of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
textDecorationYesText decoration type

Implementation Reference

  • Complete MCP tool definition for 'set_text_decoration': registers the tool with server.tool(), defines Zod input schema (nodeId: string, textDecoration: enum["NONE","UNDERLINE","STRIKETHROUGH"]), and provides handler function that sends command to Figma via sendCommandToFigma and returns success/error text response.
    server.tool(
      "set_text_decoration",
      "Set the text decoration of a text node in Figma",
      {
        nodeId: z.string().describe("The ID of the text node to modify"),
        textDecoration: z.enum(["NONE", "UNDERLINE", "STRIKETHROUGH"]).describe("Text decoration type"),
      },
      async ({ nodeId, textDecoration }) => {
        try {
          const result = await sendCommandToFigma("set_text_decoration", {
            nodeId,
            textDecoration
          });
          const typedResult = result as { name: string, textDecoration: string };
          return {
            content: [
              {
                type: "text",
                text: `Updated text decoration of node "${typedResult.name}" to ${typedResult.textDecoration}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting text decoration: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • registerTools calls registerTextTools(server), which registers the set_text_decoration tool among others.
    registerTextTools(server);
  • Main server initialization calls registerTools(server), indirectly registering set_text_decoration.
    registerTools(server);
  • Input schema validation using Zod for the tool parameters.
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      textDecoration: z.enum(["NONE", "UNDERLINE", "STRIKETHROUGH"]).describe("Text decoration type"),
    },
  • Type definition including 'set_text_decoration' in FigmaCommand union type.
    | "set_text_decoration"

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