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);
    }
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It mentions 'add to your context' without explaining what that entails—e.g., whether this is a read-only operation, if it modifies state, requires authentication, or has side effects. No rate limits, error conditions, or output format are disclosed, leaving key behaviors opaque.

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, clear sentence with no wasted words, making it easy to parse. However, it's front-loaded with minimal detail, which could be seen as under-specified rather than optimally concise. It earns a 4 for efficiency but loses a point for potential undershooting of necessary information.

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 no annotations, no output schema, and a vague description, the tool definition is incomplete. The description doesn't clarify what 'add to your context' means operationally, what the tool returns, or how it interacts with siblings. For a tool with one parameter but unclear behavior, this leaves significant gaps for an agent to understand its use.

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 the parameter 'url' fully documented in the schema. The description adds no additional meaning beyond the schema, such as URL format examples or constraints. Baseline 3 is appropriate since the schema handles parameter documentation adequately.

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 this tool from its siblings (e.g., view_node, post_comment), which all involve Figma files in some way. The purpose is understandable but lacks specificity about the actual outcome.

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 like view_node or other siblings. The description implies it's for adding files, but it doesn't specify prerequisites, timing, or exclusions. This leaves the agent without clear direction on tool selection in context.

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/MatthewDailey/figma-mcp'

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