Skip to main content
Glama

set_annotation

Create or update annotations in Figma designs programmatically, enabling structured and dynamic markups within your design workflow.

Instructions

Create or update an annotation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the MCP tool 'set_annotation', including inline schema definition and handler function that forwards the command to the Figma plugin via WebSocket.
    server.tool( "set_annotation", "Create or update an annotation", { nodeId: z.string().describe("The ID of the node to annotate"), annotationId: z.string().optional().describe("The ID of the annotation to update (if updating existing annotation)"), labelMarkdown: z.string().describe("The annotation text in markdown format"), categoryId: z.string().optional().describe("The ID of the annotation category"), properties: z.array(z.object({ type: z.string() })).optional().describe("Additional properties for the annotation") }, async ({ nodeId, annotationId, labelMarkdown, categoryId, properties }) => { try { const result = await sendCommandToFigma("set_annotation", { nodeId, annotationId, labelMarkdown, categoryId, properties }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error setting annotation: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • Handler function for 'set_annotation' tool. It constructs parameters and sends 'set_annotation' command to Figma plugin server via sendCommandToFigma, returns result or error as MCP content.
    async ({ nodeId, annotationId, labelMarkdown, categoryId, properties }) => { try { const result = await sendCommandToFigma("set_annotation", { nodeId, annotationId, labelMarkdown, categoryId, properties }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error setting annotation: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • Zod input schema for 'set_annotation' tool parameters: nodeId (required), annotationId (optional), labelMarkdown (required), categoryId (optional), properties (optional array).
    { nodeId: z.string().describe("The ID of the node to annotate"), annotationId: z.string().optional().describe("The ID of the annotation to update (if updating existing annotation)"), labelMarkdown: z.string().describe("The annotation text in markdown format"), categoryId: z.string().optional().describe("The ID of the annotation category"), properties: z.array(z.object({ type: z.string() })).optional().describe("Additional properties for the annotation") },
  • TypeScript type definition for set_annotation command parameters used in sendCommandToFigma.
    set_annotation: { nodeId: string; annotationId?: string; labelMarkdown: string; categoryId?: string; properties?: Array<{ type: string }>; };

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/pipethedev/Talk-to-Figma-MCP'

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