get_annotations
Extract all annotations from a Figma document or specific node, enabling programmatic access to design comments and notes via the Talk to Figma MCP server.
Instructions
Get all annotations in the current document or specific node
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function executes the get_annotations tool logic by sending a 'get_annotations' command to the Figma plugin with optional nodeId and includeCategories parameters, then returns the result as text content or an error message.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 using Zod for validation: optional nodeId (string) and optional includeCategories (boolean, 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") },
- src/talk_to_figma_mcp/server.ts:1002-1034 (registration)Registration of the get_annotations tool using McpServer.tool() method, including name, description, input schema, and handler reference.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)}` } ] }; } } );