Skip to main content
Glama
andreycretsu

Cursor Talk to Figma MCP

by andreycretsu

set_instance_overrides

Apply copied component overrides to selected instances in Figma, swapping them to match the source component's properties.

Instructions

Apply previously copied overrides to selected component instances. Target instances will be swapped to the source component and all copied override properties will be applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceInstanceIdYesID of the source component instance
targetNodeIdsYesArray of target instance IDs. Currently selected instances will be used.

Implementation Reference

  • Registration of the 'set_instance_overrides' MCP tool, including schema, description, and handler function.
    server.tool(
      "set_instance_overrides",
      "Apply previously copied overrides to selected component instances. Target instances will be swapped to the source component and all copied override properties will be applied.",
      {
        sourceInstanceId: z.string().describe("ID of the source component instance"),
        targetNodeIds: z.array(z.string()).describe("Array of target instance IDs. Currently selected instances will be used.")
      },
      async ({ sourceInstanceId, targetNodeIds }) => {
        try {
          const result = await sendCommandToFigma("set_instance_overrides", {
            sourceInstanceId: sourceInstanceId,
            targetNodeIds: targetNodeIds || []
          });
          const typedResult = result as setInstanceOverridesResult;
          
          if (typedResult.success) {
            const successCount = typedResult.results?.filter(r => r.success).length || 0;
            return {
              content: [
                {
                  type: "text",
                  text: `Successfully applied ${typedResult.totalCount || 0} overrides to ${successCount} instances.`
                }
              ]
            };
          } else {
            return {
              content: [
                {
                  type: "text",
                  text: `Failed to set instance overrides: ${typedResult.message}`
                }
              ]
            };
          }
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error setting instance overrides: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • The handler function that executes the set_instance_overrides tool logic by forwarding the command to the Figma plugin via sendCommandToFigma and processing the result.
    async ({ sourceInstanceId, targetNodeIds }) => {
      try {
        const result = await sendCommandToFigma("set_instance_overrides", {
          sourceInstanceId: sourceInstanceId,
          targetNodeIds: targetNodeIds || []
        });
        const typedResult = result as setInstanceOverridesResult;
        
        if (typedResult.success) {
          const successCount = typedResult.results?.filter(r => r.success).length || 0;
          return {
            content: [
              {
                type: "text",
                text: `Successfully applied ${typedResult.totalCount || 0} overrides to ${successCount} instances.`
              }
            ]
          };
        } else {
          return {
            content: [
              {
                type: "text",
                text: `Failed to set instance overrides: ${typedResult.message}`
              }
            ]
          };
        }
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error setting instance overrides: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
    }
  • Zod input schema for the set_instance_overrides tool defining parameters sourceInstanceId and targetNodeIds.
    {
      sourceInstanceId: z.string().describe("ID of the source component instance"),
      targetNodeIds: z.array(z.string()).describe("Array of target instance IDs. Currently selected instances will be used.")
    },
  • TypeScript interface defining the expected result structure from the Figma plugin for set_instance_overrides.
    interface setInstanceOverridesResult {
      success: boolean;
      message: string;
      totalCount?: number;
      results?: Array<{
        success: boolean;
        instanceId: string;
        instanceName: string;
        appliedCount?: number;
        message?: string;
      }>;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden. It describes the mutation action ('swapped', 'applied') but lacks critical behavioral details: whether this is destructive, requires specific permissions, has rate limits, or what happens to existing properties. The phrase 'target instances will be swapped' suggests a potentially significant change, but this isn't elaborated.

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

Conciseness4/5

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

Two concise sentences that efficiently convey the core functionality. The description is front-loaded with the main action. No wasted words, though it could be slightly more structured with explicit prerequisites.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover error conditions, return values, or important behavioral aspects like whether the operation is reversible. The context of 'previously copied overrides' is mentioned but not explained in relation to tool workflow.

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 adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain format of IDs or what 'previously copied' means in relation to parameters). 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.

Purpose4/5

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

The description clearly states the action ('Apply previously copied overrides') and target ('selected component instances'), with specific details about swapping to source component and applying override properties. It doesn't explicitly distinguish from sibling tools like 'get_instance_overrides' or 'clone_node', but the purpose is well-defined.

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

Usage Guidelines2/5

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

The description mentions 'previously copied overrides' and 'currently selected instances will be used' as contextual hints, but provides no explicit guidance on when to use this tool versus alternatives like 'clone_node' or 'set_multiple_annotations'. No prerequisites or exclusions are stated.

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/andreycretsu/cursor-talk-to-figma-mcp-main'

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