get_annotations
Retrieve design annotations from Figma documents to access feedback, comments, and notes for specific nodes or entire files.
Instructions
Get all annotations in the current document or specific node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | No | Optional node ID to get annotations for specific node | |
| includeCategories | No | Whether to include category information |
Implementation Reference
- src/talk_to_figma_mcp/server.ts:972-1004 (registration)Registration of the 'get_annotations' MCP tool, including inline schema definition and handler function. The handler forwards the request to the Figma plugin via sendCommandToFigma and returns the result as a text content block.server.tool( "get_annotations", "Get all annotations in the current document or specific node", { nodeId: z.string().optional().describe("Optional node ID to get annotations for specific node"), includeCategories: z.boolean().optional().default(true).describe("Whether to include category information") }, async ({ nodeId, includeCategories }) => { try { const result = await sendCommandToFigma("get_annotations", { nodeId, includeCategories }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting annotations: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- src/talk_to_figma_mcp/server.ts:979-1004 (handler)The handler function executes the tool logic by calling sendCommandToFigma with the 'get_annotations' command and parameters, then formats the result as MCP content.async ({ nodeId, includeCategories }) => { try { const result = await sendCommandToFigma("get_annotations", { nodeId, includeCategories }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error getting annotations: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- Input schema for the get_annotations tool using Zod validation: optional nodeId and includeCategories (default true).{ nodeId: z.string().optional().describe("Optional node ID to get annotations for specific node"), includeCategories: z.boolean().optional().default(true).describe("Whether to include category information") },