Skip to main content
Glama

read_comments

Retrieve all comments from a Figma file by providing the file key. Integrates with the Figma MCP Server to enable AI assistants to analyze and interact with design feedback in chat interfaces.

Instructions

Get all comments on a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYesThe key of the Figma file

Implementation Reference

  • MCP tool handler for 'read_comments': calls readComments helper and returns JSON stringified comments as text content.
    async function doReadComments(fileKey: string): Promise<CallToolResult> { const data = await readComments(fileKey); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
  • Core helper function that makes the Figma API call to retrieve comments for a file.
    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; }
  • Tool schema definition for 'read_comments', including name, description, and input schema requiring 'file_key'.
    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:275-277 (registration)
    Dispatch registration in CallToolRequestHandler: routes 'read_comments' calls to doReadComments handler.
    if (request.params.name === "read_comments") { const input = request.params.arguments as { file_key: string }; return doReadComments(input.file_key);
  • index.ts:138-140 (registration)
    Registers 'read_comments' tool (via READ_COMMENTS) in the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ADD_FIGMA_FILE, VIEW_NODE, READ_COMMENTS, POST_COMMENT, REPLY_TO_COMMENT], }));

Other Tools

Related 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