Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

get_figjam_elements

Retrieve all FigJam elements including stickies, connectors, shapes with text, sections, and stamps from the current page to read the board's contents.

Instructions

Get all FigJam-specific elements (stickies, connectors, shapes with text, sections, stamps) on the current page. Use this to read the contents of a FigJam board.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main tool handler for 'get_figjam_elements'. Registers via server.tool() and calls sendCommandToFigma('get_figjam_elements', {}). Returns the result as JSON text.
    server.tool(
      "get_figjam_elements",
      "Get all FigJam-specific elements (stickies, connectors, shapes with text, sections, stamps) on the current page. Use this to read the contents of a FigJam board.",
      {},
      async () => {
        try {
          const result = await sendCommandToFigma("get_figjam_elements", {});
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error getting FigJam elements: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
          };
        }
      }
    );
  • The registerTools function calls registerFigJamTools(server) which registers the tool on the MCP server instance.
    export function registerTools(server: McpServer): void {
      // Register all tool categories
      registerDocumentTools(server);
      registerCreationTools(server);
      registerModificationTools(server);
      registerTextTools(server);
      registerComponentTools(server);
      registerImageTools(server);
      registerSvgTools(server);
      registerVariableTools(server);
      registerFigJamTools(server);
      registerStyleTools(server);
    }
  • The FigmaCommand union type includes 'get_figjam_elements' as a valid command literal, used for type safety when sending commands via WebSocket.
    | "get_figjam_elements"
    | "create_sticky"
    | "set_sticky_text"
    | "create_shape_with_text"
    | "create_connector"
    | "create_section";
  • The sendCommandToFigma function sends the 'get_figjam_elements' command over WebSocket to the Figma plugin and returns a promise with the response.
    export function sendCommandToFigma(
      command: FigmaCommand,
      params: unknown = {},
      timeoutMs: number = 300000
    ): Promise<unknown> {
      return new Promise((resolve, reject) => {
        // If not connected, try to connect first
        if (!ws || ws.readyState !== WebSocket.OPEN) {
          connectToFigma();
          reject(new Error("Not connected to Figma. Attempting to connect..."));
          return;
        }
    
        // Check if we need a channel for this command
        const requiresChannel = command !== "join";
        if (requiresChannel && !currentChannel) {
          reject(new Error("Must join a channel before sending commands"));
          return;
        }
    
        const id = uuidv4();
        const request = {
          id,
          type: command === "join" ? "join" : "message",
          ...(command === "join"
            ? { channel: (params as any).channel, sessionId: SESSION_ID }
            : { channel: currentChannel }),
          message: {
            id,
            command,
            params: {
              ...(params as any),
              commandId: id, // Include the command ID in params
            },
          },
        };
    
        // Set timeout for request
        const timeout = setTimeout(() => {
          if (pendingRequests.has(id)) {
            pendingRequests.delete(id);
            logger.error(`Request ${id} to Figma timed out after ${timeoutMs / 1000} seconds`);
            reject(new Error('Request to Figma timed out'));
          }
        }, timeoutMs);
    
        // Store the promise callbacks to resolve/reject later
        pendingRequests.set(id, {
          resolve,
          reject,
          timeout,
          lastActivity: Date.now()
        });
    
        // Send the request
        logger.info(`Sending command to Figma: ${command}`);
        logger.debug(`Request details: ${JSON.stringify(request)}`);
        ws.send(JSON.stringify(request));
      });
    }
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It states 'read the contents,' implying read-only behavior without side effects, but does not disclose potential performance implications, size limits, or default behavior if the page has no FigJam elements. The description adds minimal behavioral context beyond the obvious read operation.

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?

Two sentences, no redundancy, front-loaded with the action and supported elements. Every word earns its place.

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?

Given no output schema exists, the description should explain the return value structure. It only says 'Get all FigJam-specific elements' without describing the format (e.g., array of objects with type, content, position). This is a significant gap for a tool with no parameters and no output schema, as the agent needs to know what shape the response takes.

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

Parameters4/5

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

There are no parameters, so schema description coverage is effectively 100%. With zero parameters, the baseline is 4, and the description adds no additional meaning needed since none is required.

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?

Description clearly states the tool retrieves all FigJam-specific elements (stickies, connectors, shapes with text, sections, stamps) on the current page, using the verb 'get' and specifying the resource. It explicitly says 'Use this to read the contents of a FigJam board,' making the purpose unambiguous and distinct from siblings like get_node_info or create_sticky.

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

Usage Guidelines4/5

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

Description provides a clear context for use ('to read the contents of a FigJam board'), implying this is the right tool for that specific task. While no explicit alternatives or when-not-to-use guidance is given, the context is strong enough to differentiate it from sibling tools that read other aspects or create elements.

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

Install Server

Other Tools

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/arinspunk/claude-talk-to-figma-mcp'

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