Skip to main content
Glama
MatthewDailey

Figma MCP Server

add_figma_file

Add a Figma file to your AI assistant's context by providing its URL, enabling design analysis and collaboration within chat interfaces.

Instructions

Add a Figma file to your context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the Figma file to add

Implementation Reference

  • The handler function that parses the Figma URL, downloads the file metadata and JSON, retrieves thumbnail, and returns a structured response with text, image, and JSON content blocks.
    async function doAddFigmaFile(url: string): Promise<CallToolResult> {
      const key = parseKeyFromUrl(url);
      const figFileJson = await downloadFigmaFile(key);
      // Claude seems to error when this is used
      // const thumbnails = await getThumbnailsOfCanvases(key, figFileJson.document);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              name: figFileJson.name,
              key,
              version: figFileJson.version,
            }),
          },
          {
            type: "text",
            text: "Here is the thumbnail of the Figma file",
          },
          {
            type: "image",
            data: figFileJson.thumbnailB64,
            mimeType: "image/png",
          },
          {
            type: "text",
            text: "Here is the JSON representation of the Figma file",
          },
          {
            type: "text",
            text: JSON.stringify(figFileJson.document),
          },
          {
            type: "text",
            text: "Here are thumbnails of the canvases in the Figma file",
          },
          // ...thumbnails
          //   .map((thumbnail) => [
          //     {
          //       type: "text" as const,
          //       text: `Next is the image of canvas ID: ${thumbnail.id}`,
          //     },
          //     {
          //       type: "image" as const,
          //       data: thumbnail.b64,
          //       mimeType: "image/png",
          //     },
          //   ])
          //   .flat(),
        ],
      };
    }
  • Defines the Tool object for 'add_figma_file' including name, description, and input schema (object with required 'url' string).
    const ADD_FIGMA_FILE: Tool = {
      name: "add_figma_file",
      description: "Add a Figma file to your context",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "The URL of the Figma file to add",
          },
        },
        required: ["url"],
      },
    };
  • index.ts:138-140 (registration)
    Registers the ADD_FIGMA_FILE tool in the server's list of available tools for ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [ADD_FIGMA_FILE, VIEW_NODE, READ_COMMENTS, POST_COMMENT, REPLY_TO_COMMENT],
    }));
  • index.ts:264-268 (registration)
    In the CallToolRequestHandler, matches the tool name 'add_figma_file' and dispatches to the doAddFigmaFile handler.
    if (request.params.name === "add_figma_file") {
      console.error("Adding Figma file", request.params.arguments);
      const input = request.params.arguments as { url: string };
      return doAddFigmaFile(input.url);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.6/5.0
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. 'Add a Figma file to your context' implies a mutation or storage action, but it doesn't clarify if this requires specific permissions, what 'context' refers to (e.g., workspace, session), whether the action is reversible, or any rate limits. The description is too vague to inform the agent adequately about behavioral traits.

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?

The description is a single, straightforward sentence that is front-loaded with the core action. It avoids unnecessary words and gets directly to the point. However, it could be more structured by including key details like the tool's scope or constraints, but as-is, it's efficiently concise.

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 lack of annotations and output schema, the description is incomplete for a tool that likely performs a mutation (adding a file). It doesn't explain what 'context' means, the result of the operation, or any error conditions. For a tool with one parameter but no structured behavioral hints, the description should provide more context to be fully helpful.

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, with the 'url' parameter clearly documented as 'The URL of the Figma file to add'. The description adds no additional meaning beyond this, such as URL format requirements or validation rules. With high schema coverage, the baseline score of 3 is appropriate, as the schema handles the parameter documentation effectively.

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

Purpose3/5

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

The description states the action ('Add') and resource ('Figma file'), but it's vague about what 'add to your context' means operationally. It doesn't distinguish from sibling tools like 'view_node' or 'post_comment', which might involve similar resources. The purpose is understandable but lacks specificity about the tool's exact function.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing a valid Figma URL or authentication, or how it differs from sibling tools like 'view_node' that might also interact with Figma files. The description offers no context for selection among available tools.

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