Skip to main content
Glama

set_text_case

Change the text case of a Figma text node using natural language commands, enabling quick formatting adjustments within AI-assisted design workflows.

Instructions

Set the text case of a text node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the set_text_case tool by sending a command to Figma via sendCommandToFigma and returning a formatted response with success or error message.
    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)}` } ] }; } } );
  • Zod schema defining input parameters: 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"), },
  • Registers the set_text_case MCP tool on the server with description, input schema, and handler function.
    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)}` } ] }; } } );
  • Higher-level registration call to registerTextTools within the overall tools registration, which includes the set_text_case tool.
    registerTextTools(server);
  • Type definition including 'set_text_case' in FigmaCommand union type for TypeScript safety.
    | "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