Skip to main content
Glama

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
NameRequiredDescriptionDefault
fileKeyYesThe key of the file to comment on
messageYesComment message text
client_metaNoOptional. Position of the comment
comment_idNoOptional. ID of comment to reply to

Implementation Reference

  • 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); }
  • 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) }], }; }

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

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