Skip to main content
Glama
MatthewDailey

Figma MCP Server

read_comments

Retrieve all comments from a Figma file to review feedback and track design discussions within collaborative projects.

Instructions

Get all comments on a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYesThe key of the Figma file

Implementation Reference

  • Dedicated handler function for the read_comments tool that fetches comments using the helper and returns formatted JSON response as CallToolResult.
    async function doReadComments(fileKey: string): Promise<CallToolResult> {
      const data = await readComments(fileKey);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Tool schema defining name, description, and input schema for read_comments.
    const READ_COMMENTS: Tool = {
      name: "read_comments",
      description: "Get all comments on a Figma file",
      inputSchema: {
        type: "object",
        properties: {
          file_key: {
            type: "string",
            description: "The key of the Figma file",
          },
        },
        required: ["file_key"],
      },
    };
  • index.ts:138-140 (registration)
    Registration of the read_comments tool (as READ_COMMENTS) in the list of available tools returned by ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [ADD_FIGMA_FILE, VIEW_NODE, READ_COMMENTS, POST_COMMENT, REPLY_TO_COMMENT],
    }));
  • Dispatch logic within the main CallToolRequest handler that routes calls to the read_comments tool to its dedicated handler.
    if (request.params.name === "read_comments") {
      const input = request.params.arguments as { file_key: string };
      return doReadComments(input.file_key);
  • Supporting utility function that performs the actual Figma API request to fetch comments for the given file key.
    export async function readComments(fileKey: string) {
      const response = await axios.get(`https://api.figma.com/v1/files/${fileKey}/comments`, {
        headers: {
          "X-FIGMA-TOKEN": getFigmaApiKey(),
        },
      });
      return response.data;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks critical details: it doesn't specify if this is a read-only operation, what permissions are required, whether it returns paginated results, error conditions, or the format of returned comments. For a tool with zero annotation coverage, this is insufficient.

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, clear sentence with zero wasted words. It is front-loaded with the core action and resource, making it highly efficient and easy to parse.

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. It doesn't address behavioral aspects like safety, permissions, or output format, which are crucial for an agent to use this tool correctly. For a tool with no structured data beyond the input schema, more context is needed.

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 single parameter 'file_key' documented as 'The key of the Figma file'. The description adds no additional meaning beyond this, such as explaining what a 'file_key' is or where to find it. 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 action ('Get all comments') and the resource ('on a Figma file'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'post_comment' or 'reply_to_comment', but the verb 'Get' versus 'post'/'reply' provides implicit distinction.

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 file_key), exclusions, or comparisons to sibling tools like 'view_node' which might also retrieve file-related data.

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