set_effect_style_id
Apply an effect style to Figma design elements by specifying node and style IDs, enabling visual customization through the Claude-Figma integration.
Instructions
Apply an effect style to a node in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node to modify | |
| effectStyleId | Yes | The ID of the effect style to apply |
Implementation Reference
- src/talk_to_figma_mcp/tools/modification-tools.ts:372-407 (registration)Full registration of the 'set_effect_style_id' MCP tool using server.tool(). Includes tool name, description, Zod input schema, and the execution handler function that forwards the command to the Figma plugin.server.tool( "set_effect_style_id", "Apply an effect style to a node in Figma", { nodeId: z.string().describe("The ID of the node to modify"), effectStyleId: z.string().describe("The ID of the effect style to apply") }, async ({ nodeId, effectStyleId }) => { try { const result = await sendCommandToFigma("set_effect_style_id", { nodeId, effectStyleId }); const typedResult = result as { name: string, effectStyleId: string }; return { content: [ { type: "text", text: `Successfully applied effect style to node "${typedResult.name}"` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error setting effect style: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- The execution handler for 'set_effect_style_id'. Sends command parameters to Figma via sendCommandToFigma and formats success/error text responses.async ({ nodeId, effectStyleId }) => { try { const result = await sendCommandToFigma("set_effect_style_id", { nodeId, effectStyleId }); const typedResult = result as { name: string, effectStyleId: string }; return { content: [ { type: "text", text: `Successfully applied effect style to node "${typedResult.name}"` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error setting effect style: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- Input schema using Zod for validating nodeId (string) and effectStyleId (string) parameters.{ nodeId: z.string().describe("The ID of the node to modify"), effectStyleId: z.string().describe("The ID of the effect style to apply") },
- src/talk_to_figma_mcp/tools/index.ts:16-16 (registration)Higher-level registration call that invokes registerModificationTools, which includes the set_effect_style_id tool.registerModificationTools(server);
- Includes 'set_effect_style_id' in the FigmaCommand type union, used for typing commands sent to the Figma plugin.| "set_effect_style_id"