Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

flatten_node

Flatten Figma nodes to prepare them for boolean operations or convert them to paths, enabling advanced design modifications.

Instructions

Flatten a node in Figma (e.g., for boolean operations or converting to path)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesID of the node to flatten

Implementation Reference

  • Full MCP tool registration including schema, description, and handler function for 'flatten_node'. The handler sends a 'flatten_node' command to the Figma plugin via websocket and formats the response.
    server.tool(
      "flatten_node",
      "Flatten a node in Figma (e.g., for boolean operations or converting to path)",
      {
        nodeId: z.string().describe("ID of the node to flatten"),
      },
      async ({ nodeId }) => {
        try {
          const result = await sendCommandToFigma("flatten_node", { nodeId });
          
          const typedResult = result as { 
            id: string, 
            name: string, 
            type: string 
          };
          
          return {
            content: [
              {
                type: "text",
                text: `Node "${typedResult.name}" flattened successfully. The new node has ID: ${typedResult.id} and is of type ${typedResult.type}.`
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error flattening node: ${error instanceof Error ? error.message : String(error)}`
              }
            ]
          };
        }
      }
    );
  • Calls registerCreationTools which registers the flatten_node tool among others.
    registerCreationTools(server);
  • Includes 'flatten_node' in the FigmaCommand type union for type safety in websocket communications.
    | "flatten_node"
Behavior2/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. While 'flatten' implies a potentially destructive transformation (changing node structure), the description doesn't clarify whether this operation is reversible, what happens to child nodes, or what permissions are required. The examples hint at technical contexts but lack operational 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 extremely concise (one sentence with a parenthetical example) and front-loaded with the core action. Every word earns its place by either stating the purpose or providing clarifying examples, with zero wasted text.

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 the complexity of a node transformation operation with no annotations and no output schema, the description is insufficient. It doesn't explain what 'flatten' means operationally, what the result looks like, whether it affects other nodes, or potential side effects—critical gaps for a tool that likely modifies document structure.

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?

The input schema has 100% description coverage (the single parameter 'nodeId' is fully documented in the schema), so the baseline is 3. The tool description adds no additional parameter information beyond what's already in the schema, maintaining this adequate but unenhanced level.

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 ('flatten') and target ('a node in Figma'), and provides concrete examples ('e.g., for boolean operations or converting to path') that help clarify the purpose. However, it doesn't explicitly differentiate this tool from its many siblings (like 'group_nodes', 'ungroup_nodes', or various creation tools), which would require a 5.

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 provides no guidance on when to use this tool versus alternatives. It mentions example use cases ('boolean operations or converting to path'), but doesn't specify prerequisites, constraints, or when other tools might be more appropriate given the extensive sibling list including transformation and grouping tools.

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/arinspunk/claude-talk-to-figma-mcp'

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