set_effect_style_id
Apply specific effect styles to Figma design nodes using AI-driven commands, enabling precise visual adjustments and design enhancements directly from natural language inputs.
Instructions
Apply an effect style to a 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
- The handler function for the 'set_effect_style_id' tool. It sends a command to Figma via sendCommandToFigma and returns success/error text response.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)}` } ] }; } }
- 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(), including inline schema and handler.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 tool parameters: nodeId (string) and effectStyleId (string).{ nodeId: z.string().describe("The ID of the node to modify"), effectStyleId: z.string().describe("The ID of the effect style to apply") },
- Type definition including 'set_effect_style_id' in the FigmaCommand union type for TypeScript safety.| "set_effect_style_id"