set_text_decoration
Modify the text decoration of a text node in Figma using natural language commands, enabling AI-assisted design customization within the Claude Talk to Figma MCP environment.
Instructions
Set the text decoration of a text node in Figma
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- Full implementation of the 'set_text_decoration' MCP tool, including registration, input schema (Zod validation), and handler logic that forwards the command to Figma plugin.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)}` } ] }; } } );
- src/talk_to_figma_mcp/tools/index.ts:17-17 (registration)Calls registerTextTools which registers the set_text_decoration tool among others.registerTextTools(server);
- src/talk_to_figma_mcp/server.ts:34-34 (registration)Top-level registration call that indirectly registers the set_text_decoration tool.registerTools(server);
- Type definition for FigmaCommand union that includes 'set_text_decoration' for the command sent to Figma.| "set_text_decoration"