Skip to main content
Glama

set_fill_style_id

Apply a fill style to a Figma design element using its style ID to maintain visual consistency across your project.

Instructions

Apply a fill style to a node in Figma. Use get_styles to find available fill style IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to modify
fillStyleIdYesThe ID of the fill style to apply

Implementation Reference

  • Full MCP tool registration for 'set_fill_style_id': includes schema validation with Zod for nodeId and fillStyleId parameters, and handler function that sends the command to Figma via websocket utility and formats response.
    server.tool(
      "set_fill_style_id",
      "Apply a fill style to a node in Figma. Use get_styles to find available fill style IDs.",
      {
        nodeId: z.string().describe("The ID of the node to modify"),
        fillStyleId: z.string().describe("The ID of the fill style to apply")
      },
      async ({ nodeId, fillStyleId }) => {
        try {
          const result = await sendCommandToFigma("set_fill_style_id", {
            nodeId,
            fillStyleId
          });
          const typedResult = result as { name: string };
          return {
            content: [
              {
                type: "text",
                text: `Successfully applied fill style to node "${typedResult.name}"`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting fill style: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • The handler executes by calling sendCommandToFigma with the parameters and returns a formatted text response based on the result.
    async ({ nodeId, fillStyleId }) => {
      try {
        const result = await sendCommandToFigma("set_fill_style_id", {
          nodeId,
          fillStyleId
        });
        const typedResult = result as { name: string };
        return {
          content: [
            {
              type: "text",
              text: `Successfully applied fill style to node "${typedResult.name}"`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting fill style: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema defining required string inputs: nodeId and fillStyleId.
      nodeId: z.string().describe("The ID of the node to modify"),
      fillStyleId: z.string().describe("The ID of the fill style to apply")
    },
  • Top-level call to registerModificationTools which includes the set_fill_style_id tool.
    registerModificationTools(server);
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It implies a mutation ('Apply') but doesn't specify permissions needed, whether changes are reversible, or error conditions. It adds some context about style ID sourcing but lacks comprehensive behavioral details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences that each serve distinct purposes: stating the tool's function and providing usage guidance. There's zero wasted language, and information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description provides adequate basic information about what the tool does and how to prepare inputs. However, it lacks details about behavioral implications, error handling, or response format, leaving some gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description doesn't add syntax or format details beyond what the schema provides, but references get_styles for fillStyleId context, offering marginal value. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Apply a fill style') and target resource ('to a node in Figma'), distinguishing it from siblings like set_fill_color or set_fill_variable. It precisely identifies the tool's function without being tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides when-to-use guidance by directing users to 'Use get_styles to find available fill style IDs,' naming an alternative tool for prerequisite information. This creates clear context for proper tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/agenisea/cc-fig-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server