Skip to main content
Glama
paragdesai1

Cursor Talk to Figma MCP

by paragdesai1

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
NameRequiredDescriptionDefault
nodeIdNoOptional node ID to get annotations for specific node
includeCategoriesNoWhether to include category information

Implementation Reference

  • 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)}`
              }
            ]
          };
        }
      }
    );
  • 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")
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / includeCategories
      Added value: +{
      +  "default": true,
      +  "description": "Whether to include category information",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / nodeId
      Added value: +{
      +  "description": "Optional node ID to get annotations for specific node",
      +  "type": "string"
      +}
  2. First observed

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It only states that the tool 'gets' annotations, revealing nothing about return format, potential side effects (e.g., read-only), or error behavior. This is insufficient for a tool without annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler. Every word carries meaning, clearly conveying the action and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple getter with two optional parameters and no output schema, the description gives the essential purpose but omits details about the return structure or how categories are represented. Given the lack of annotations and output schema, a bit more context would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides 100% coverage for both parameters (nodeId and includeCategories) with descriptive texts. The tool description adds no additional parameter insights, so it neither compensates for gaps nor enhances understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('Get') and resource ('annotations'), and further specifies scope ('in the current document or specific node'). This distinguishes it from sibling write tools like set_annotation and set_multiple_annotations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving annotations from either the whole document or a specific node, but it does not explicitly state when to prefer this over alternatives (e.g., get_reactions) or mention any exclusions. Sibling tools are not referenced.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.