post_comment
Add comments to Figma files to provide feedback, mark specific elements, or reply to existing discussions for collaborative design review.
Instructions
Post a comment on a Figma file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileKey | Yes | The key of the file to comment on | |
| message | Yes | Comment message text | |
| client_meta | No | Optional. Position of the comment | |
| comment_id | No | Optional. ID of comment to reply to |
Implementation Reference
- src/handlers/files.ts:66-70 (handler)The core handler function for the 'post_comment' tool. It destructures the fileKey and comment data from args and makes a POST request to the Figma API endpoint for comments.async postComment(args: PostCommentArgs) { const { fileKey, ...commentData } = args; return this.api.makeRequest(`/files/${fileKey}/comments`, 'POST', commentData); }
- src/types/files.ts:31-44 (schema)TypeScript interface defining the input arguments for the post_comment tool, used for type checking.export interface PostCommentArgs { fileKey: string; message: string; client_meta?: { x: number; y: number; node_id?: string; node_offset?: { x: number; y: number; }; }; comment_id?: string; }
- src/index.ts:235-272 (registration)MCP tool registration in ListTools handler, defining the name, description, and input schema for 'post_comment'.{ name: 'post_comment', description: 'Post a comment on a Figma file', inputSchema: { type: 'object', properties: { fileKey: { type: 'string', description: 'The key of the file to comment on' }, message: { type: 'string', description: 'Comment message text' }, client_meta: { type: 'object', properties: { x: { type: 'number' }, y: { type: 'number' }, node_id: { type: 'string' }, node_offset: { type: 'object', properties: { x: { type: 'number' }, y: { type: 'number' } } } }, description: 'Optional. Position of the comment' }, comment_id: { type: 'string', description: 'Optional. ID of comment to reply to' } }, required: ['fileKey', 'message'] }, },
- src/index.ts:530-536 (registration)MCP CallTool request handler case for 'post_comment', which validates args and delegates to FilesHandler.postComment.case 'post_comment': { const args = this.validateArgs<PostCommentArgs>(request.params.arguments, ['fileKey', 'message']); const result = await this.filesHandler.postComment(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }