get_annotations
Retrieve all annotations from a Figma document or specific node using the Cursor AI integration, enabling seamless design review and collaboration.
Instructions
Get all annotations in the current document or specific node
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/server.ts:972-1004 (handler)The handler function for the 'get_annotations' MCP tool. It proxies the request to the Figma plugin via sendCommandToFigma, serializes the result as JSON text response, and handles errors.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 definition 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") },
- src/talk_to_figma_mcp/server.ts:972-972 (registration)Registration of the 'get_annotations' tool on the MCP server with name, description, schema, and handler.server.tool(