Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

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
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to modify
effectStyleIdYesThe ID of the effect style to apply

Implementation Reference

  • 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")
    },
  • 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"

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