get_annotations
Retrieve all design annotations from a Figma document or specific node using AI-driven communication between Cursor and Figma, streamlining design automation tasks.
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 for the 'get_annotations' MCP tool. It calls sendCommandToFigma to retrieve annotations from the Figma plugin, handling optional nodeId and includeCategories parameters, and returns the result as JSON or an error message.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)}` } ] }; } } );
- Input schema for the get_annotations tool using Zod validation: optional nodeId (string) and 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-1003 (registration)Registration of the 'get_annotations' tool with McpServer using server.tool() method.server.tool( "get_annotations",