set_effect_style_id
Apply a specific effect style to a design element in Figma by providing the node ID and effect style ID to modify visual properties.
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
- MCP tool handler registration for set_effect_style_id, including input schema (nodeId, effectStyleId) and execution logic that delegates to Figma's set_effect_style_id command via sendCommandToFigma.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)}` } ] }; } } );
- Zod input schema for the set_effect_style_id tool.{ 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/modification-tools.ts:372-407 (registration)Registration of the set_effect_style_id tool on the MCP server using server.tool.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)}` } ] }; } } );
- Type definition for FigmaCommand union including 'set_effect_style_id' used internally for websocket commands.export type FigmaCommand = | "get_document_info" | "get_selection" | "get_node_info" | "create_rectangle" | "create_frame" | "create_text" | "create_ellipse" | "create_polygon" | "create_star" | "create_vector" | "create_line" | "set_fill_color" | "set_stroke_color" | "move_node" | "resize_node" | "delete_node" | "get_styles" | "get_local_components" | "get_team_components" | "create_component_instance" | "export_node_as_image" | "join" | "set_corner_radius" | "clone_node" | "set_text_content" | "scan_text_nodes" | "set_multiple_text_contents" | "set_auto_layout" | "set_font_name" | "set_font_size" | "set_font_weight" | "set_letter_spacing" | "set_line_height" | "set_paragraph_spacing" | "set_text_case" | "set_text_decoration" | "get_styled_text_segments" | "load_font_async" | "get_remote_components" | "set_effects" | "set_effect_style_id" | "group_nodes" | "ungroup_nodes" | "flatten_node" | "insert_child";