Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

get_annotation

Retrieve feedback and comments attached to a specific Figma design element by providing its node ID.

Instructions

Read annotations from a node in Figma. Uses the proposed Annotations API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to read annotations from

Implementation Reference

  • The handler function that registers and implements the 'get_annotation' tool. It takes a nodeId parameter, calls sendCommandToFigma to retrieve annotations from a Figma node, and returns the node name and annotations as JSON text.
    server.tool(
      "get_annotation",
      "Read annotations from a node in Figma. Uses the proposed Annotations API.",
      {
        nodeId: z.string().describe("The ID of the node to read annotations from"),
      },
      async ({ nodeId }) => {
        try {
          const result = await sendCommandToFigma("get_annotation", { nodeId });
          const typedResult = result as { name: string; annotations: any[] };
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ name: typedResult.name, annotations: typedResult.annotations }, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting annotations: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The tool is registered via server.tool() with the name 'get_annotation'. Registration and handler are in the same call.
    server.tool(
      "get_annotation",
      "Read annotations from a node in Figma. Uses the proposed Annotations API.",
      {
        nodeId: z.string().describe("The ID of the node to read annotations from"),
      },
      async ({ nodeId }) => {
        try {
          const result = await sendCommandToFigma("get_annotation", { nodeId });
          const typedResult = result as { name: string; annotations: any[] };
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({ name: typedResult.name, annotations: typedResult.annotations }, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting annotations: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The 'get_annotation' string literal is included in the FigmaCommand union type, serving as a type-level schema for valid commands that can be sent to Figma.
    | "set_annotation"
    | "get_annotation"
    | "get_variables"
    | "set_variable"
    | "apply_variable_to_node"
    | "switch_variable_mode"
    | "get_figjam_elements"
    | "create_sticky"
    | "set_sticky_text"
    | "create_shape_with_text"
    | "create_connector"
    | "create_section";

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.2

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description must bear the burden of behavioral disclosure. It only states it reads annotations, but does not address edge cases (e.g., node not found, no annotations), response format, or any limitations related to the proposed API.

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

Conciseness4/5

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

The description is very short (two sentences) with no redundancy. The second sentence about the proposed API is slightly extraneous but does not detract from clarity.

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

Completeness2/5

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

With no output schema, the description should at least hint at the return format or contents of annotations. It fails to do so, leaving the agent uncertain about what to expect. Additionally, the mention of a 'proposed' API suggests instability but lacks further context.

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 covers 100% of parameters with a description for nodeId. The description adds no additional meaning beyond the schema, so a baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool reads annotations from a node, distinguishing it from sibling tools like set_annotation that write. The verb 'read' and resource 'annotations' are specific, but it could be more explicit about the context of annotations.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. While set_annotation exists as a sibling for writing, the description does not mention it or provide any when-to-use or when-not-to-use advice.

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

Deploy Server

Other Tools