Skip to main content
Glama

export_node_as_image

Convert Figma design elements to image files by specifying node ID, format, and scale for use in documentation or presentations.

Instructions

Export a node as an image from Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to export
formatNoExport format
scaleNoExport scale

Implementation Reference

  • Full registration of the 'export_node_as_image' MCP tool, including name, description, Zod input schema, and inline handler function that forwards the command to the Figma plugin via sendCommandToFigma and returns the resulting image.
      server.tool(
        "export_node_as_image",
        "Export a node as an image from Figma",
        {
          nodeId: z.string().describe("The ID of the node to export"),
          format: z
            .enum(["PNG", "JPG", "SVG", "PDF"])
            .optional()
            .describe("Export format"),
          scale: z.number().positive().optional().describe("Export scale"),
        },
        async ({ nodeId, format, scale }) => {
          try {
            const result = await sendCommandToFigma("export_node_as_image", {
              nodeId,
              format: format || "PNG",
              scale: scale || 1,
            });
            const typedResult = result as { imageData: string; mimeType: string };
    
            return {
              content: [
                {
                  type: "image",
                  data: typedResult.imageData,
                  mimeType: typedResult.mimeType || "image/png",
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: "text",
                  text: `Error exporting node as image: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
            };
          }
        }
      );
    }
  • The core handler logic for executing the export_node_as_image tool: validates inputs, sends command to Figma WebSocket, handles response as image data or error.
    async ({ nodeId, format, scale }) => {
      try {
        const result = await sendCommandToFigma("export_node_as_image", {
          nodeId,
          format: format || "PNG",
          scale: scale || 1,
        });
        const typedResult = result as { imageData: string; mimeType: string };
    
        return {
          content: [
            {
              type: "image",
              data: typedResult.imageData,
              mimeType: typedResult.mimeType || "image/png",
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error exporting node as image: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    }
  • Zod schema for input validation of the export_node_as_image tool: nodeId (string, required), format (enum PNG/JPG/SVG/PDF, optional), scale (positive number, optional).
    {
      nodeId: z.string().describe("The ID of the node to export"),
      format: z
        .enum(["PNG", "JPG", "SVG", "PDF"])
        .optional()
        .describe("Export format"),
      scale: z.number().positive().optional().describe("Export scale"),
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Export' which implies a read operation that generates output, but doesn't disclose behavioral traits like whether it requires specific permissions, what happens on failure, if it's rate-limited, or the nature of the output (e.g., file format details beyond the schema's enum). For a tool with no annotation coverage, this is a significant gap.

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 a single, efficient sentence that front-loads the core action ('Export a node as an image from Figma'). There is zero waste, and it's appropriately sized for the tool's complexity.

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?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It states the purpose clearly but lacks behavioral context and usage guidelines. With no output schema, it doesn't explain return values (e.g., image data or file reference), which is a gap for an export tool.

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 all three parameters (nodeId, format, scale) with descriptions and constraints. The description adds no additional meaning beyond the schema's details, such as explaining what a 'node' represents in Figma or providing context for scale values. Baseline 3 is appropriate 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 ('Export') and resource ('a node as an image from Figma'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling export tools (none are listed in the provided siblings, but in a broader Figma context, there might be other export functions).

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 doesn't mention prerequisites (e.g., needing a valid node ID), exclusions, or comparisons to other tools. The sibling list includes many Figma manipulation tools, but no explicit export alternatives are named.

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