Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

set_text_case

Change text case in Figma design files by modifying text nodes to UPPER, LOWER, TITLE, or ORIGINAL case through Claude AI commands.

Instructions

Set the text case of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the text node to modify
textCaseYesText case type

Implementation Reference

  • MCP tool registration for 'set_text_case', including schema validation with Zod and handler that sends the command to Figma plugin and returns success/error message.
    server.tool(
      "set_text_case",
      "Set the text case of a text node in Figma",
      {
        nodeId: z.string().describe("The ID of the text node to modify"),
        textCase: z.enum(["ORIGINAL", "UPPER", "LOWER", "TITLE"]).describe("Text case type"),
      },
      async ({ nodeId, textCase }) => {
        try {
          const result = await sendCommandToFigma("set_text_case", {
            nodeId,
            textCase
          });
          const typedResult = result as { name: string, textCase: string };
          return {
            content: [
              {
                type: "text",
                text: `Updated text case of node "${typedResult.name}" to ${typedResult.textCase}`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting text case: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Handler function for the 'set_text_case' tool that executes the logic by calling sendCommandToFigma and formats the response.
    async ({ nodeId, textCase }) => {
      try {
        const result = await sendCommandToFigma("set_text_case", {
          nodeId,
          textCase
        });
        const typedResult = result as { name: string, textCase: string };
        return {
          content: [
            {
              type: "text",
              text: `Updated text case of node "${typedResult.name}" to ${typedResult.textCase}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting text case: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Input schema for 'set_text_case' tool using Zod: nodeId (string) and textCase (enum: ORIGINAL, UPPER, LOWER, TITLE).
    {
      nodeId: z.string().describe("The ID of the text node to modify"),
      textCase: z.enum(["ORIGINAL", "UPPER", "LOWER", "TITLE"]).describe("Text case type"),
    },
  • 'set_text_case' included in FigmaCommand type union for internal type safety when sending commands.
    | "set_text_case"

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