reply_to_comment
Add a reply to an existing comment in a Figma file to provide feedback, answer questions, or continue design discussions directly within the Figma MCP Server.
Instructions
Reply to an existing comment in a Figma file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_key | Yes | The key of the Figma file | |
| comment_id | Yes | The ID of the comment to reply to. Comment ids have the format `<number>` | |
| message | Yes | The reply message |
Implementation Reference
- index.ts:247-261 (handler)The handler function that executes the reply_to_comment tool logic by calling the replyToComment helper and formatting the result.async function doReplyToComment( fileKey: string, commentId: string, message: string ): Promise<CallToolResult> { const data = await replyToComment(fileKey, commentId, message); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), }, ], }; }
- index.ts:115-136 (schema)Defines the Tool object for 'reply_to_comment' including name, description, and input schema.const REPLY_TO_COMMENT: Tool = { name: "reply_to_comment", description: "Reply to an existing comment in a Figma file", inputSchema: { type: "object", properties: { file_key: { type: "string", description: "The key of the Figma file", }, comment_id: { type: "string", description: "The ID of the comment to reply to. Comment ids have the format `<number>`", }, message: { type: "string", description: "The reply message", }, }, required: ["file_key", "comment_id", "message"], }, };
- index.ts:138-140 (registration)Registers the REPLY_TO_COMMENT tool in the server's list of available tools.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ADD_FIGMA_FILE, VIEW_NODE, READ_COMMENTS, POST_COMMENT, REPLY_TO_COMMENT], }));
- figma_api.ts:133-148 (helper)Helper function that makes the actual API call to Figma to reply to a comment.export async function replyToComment(fileKey: string, commentId: string, message: string) { const response = await axios.post( `https://api.figma.com/v1/files/${fileKey}/comments`, { message, comment_id: commentId, }, { headers: { "X-FIGMA-TOKEN": getFigmaApiKey(), "Content-Type": "application/json", }, } ); return response.data; }