Skip to main content
Glama

set_stroke_style_id

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

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to modify
strokeStyleIdYesThe ID of the stroke style to apply

Implementation Reference

  • Full registration of the MCP tool 'set_stroke_style_id' including description, Zod input schema, and async handler function that forwards the command to Figma via sendCommandToFigma.
    server.tool(
      "set_stroke_style_id",
      "Apply a stroke style to a node in Figma. Use get_styles to find available stroke style IDs.",
      {
        nodeId: z.string().describe("The ID of the node to modify"),
        strokeStyleId: z.string().describe("The ID of the stroke style to apply")
      },
      async ({ nodeId, strokeStyleId }) => {
        try {
          const result = await sendCommandToFigma("set_stroke_style_id", {
            nodeId,
            strokeStyleId
          });
          const typedResult = result as { name: string };
          return {
            content: [
              {
                type: "text",
                text: `Successfully applied stroke style to node "${typedResult.name}"`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting stroke style: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
  • The handler function executes the tool logic by sending the 'set_stroke_style_id' command to Figma and returning success/error messages.
    async ({ nodeId, strokeStyleId }) => {
      try {
        const result = await sendCommandToFigma("set_stroke_style_id", {
          nodeId,
          strokeStyleId
        });
        const typedResult = result as { name: string };
        return {
          content: [
            {
              type: "text",
              text: `Successfully applied stroke style to node "${typedResult.name}"`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting stroke style: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod schema for input validation: requires nodeId (string) and strokeStyleId (string).
    {
      nodeId: z.string().describe("The ID of the node to modify"),
      strokeStyleId: z.string().describe("The ID of the stroke style to apply")
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description states 'Apply a stroke style to a node,' which implies a mutation operation, but it doesn't disclose any behavioral traits such as permission requirements, whether the change is reversible, error conditions, or what happens if the node doesn't support strokes. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise with two sentences that are front-loaded and waste no words. The first sentence states the core purpose, and the second provides essential usage guidance. Every sentence earns its place, making it efficient and well-structured.

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

Completeness2/5

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

Given that this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, permissions, or what the tool returns (e.g., success/failure, updated node info). The mention of 'get_styles' helps, but for a tool that modifies data, more context is needed to ensure safe and correct usage by an AI agent.

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%, with both parameters ('nodeId' and 'strokeStyleId') clearly documented in the schema. The description adds minimal value beyond the schema by implying that strokeStyleId values come from 'get_styles,' but doesn't provide additional syntax, format details, or constraints. This meets the baseline of 3 when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Apply') and resource ('stroke style to a node'), making the purpose immediately understandable. It distinguishes this tool from other styling tools like 'set_stroke_color' or 'set_effect_style_id' by specifying it's for stroke styles specifically. However, it doesn't explicitly differentiate from 'set_stroke_variable' which might be a related alternative.

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

Usage Guidelines4/5

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

The description provides clear context by mentioning 'Use get_styles to find available stroke style IDs,' which indicates a prerequisite workflow. This helps the agent understand when to use this tool (after obtaining style IDs via get_styles). However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings like 'set_stroke_color' or 'set_stroke_variable'.

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