Skip to main content
Glama
alucardeht

Figma MCP

by alucardeht

list_frames

Retrieve frames and screens from a Figma page by name, returning a compact list with names, sizes, and IDs for navigation and asset extraction workflows.

Instructions

List frames/screens in a specific page.

HOW IT WORKS:

  • Search by page name (partial match supported)

  • Large pages (>50 frames) are automatically chunked

  • Returns compact list with frame names, sizes, and IDs

  • Session remembers what was sent

TYPICAL WORKFLOW:

  1. list_pages → find page name

  2. list_frames(page_name) → see frames

  3. get_frame_info(frame_name) → detail one frame

  4. extract_assets(frame_name) → get assets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_keyYesFigma file key
page_nameYesPage name (partial match, case-insensitive)
continueNoContinue from last response if more frames available

Implementation Reference

  • Core handler function that lists frames in a specified Figma page. Handles continuation for large lists, fetches file data, filters frames/components, computes dimensions, and wraps responses with chunker for MCP compatibility.
    export async function listFrames(ctx, fileKey, pageName, continueFlag = false) {
      const { session, chunker, figmaClient } = ctx;
      const operationId = `list_frames:${fileKey}:${pageName}`;
    
      if (continueFlag && session.hasPendingChunks(operationId)) {
        const chunk = session.getNextChunk(operationId);
        const response = chunker.wrapResponse(
          { frames: chunk.items },
          {
            step: `Showing frames ${(chunk.chunkIndex - 1) * 20 + 1}-${Math.min(chunk.chunkIndex * 20, chunk.totalItems)}`,
            progress: `${chunk.chunkIndex}/${chunk.totalChunks}`,
            nextStep: chunk.chunkIndex < chunk.totalChunks ? "Call with continue=true for more" : "Use get_frame_info to detail a frame",
            operationId,
          }
        );
        return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] };
      }
    
      session.setCurrentFile(fileKey);
      const file = await figmaClient.getFile(fileKey, 2);
      const page = figmaClient.findPageByName(file, pageName);
    
      if (!page) {
        const available = file.document.children.map((p) => p.name).join(", ");
        throw new Error(`Page "${pageName}" not found. Available: ${available}`);
      }
    
      const frames = (page.children || [])
        .filter((c) => c.type === "FRAME" || c.type === "COMPONENT" || c.type === "COMPONENT_SET")
        .map((f) => {
          session.markFrameExplored(f.id);
          return {
            name: f.name,
            id: f.id,
            type: f.type,
            width: Math.round(f.absoluteBoundingBox?.width || 0),
            height: Math.round(f.absoluteBoundingBox?.height || 0),
            childCount: f.children?.length || 0,
          };
        });
    
      const chunked = chunker.chunkArray(frames, operationId, 20);
    
      if (chunked) {
        const response = chunker.wrapResponse(
          { page: page.name, frameCount: frames.length, frames: chunked.items },
          {
            step: `Showing frames 1-${chunked.items.length} of ${chunked.totalItems}`,
            progress: `1/${chunked.totalChunks}`,
            nextStep: "Call with continue=true for more, or get_frame_info for details",
            alert: `Page has ${frames.length} frames - showing first ${chunked.items.length}`,
            strategy: "Review visible frames, continue if needed, then detail specific ones",
            operationId,
          }
        );
        return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] };
      }
    
      const response = chunker.wrapResponse(
        { page: page.name, frameCount: frames.length, frames },
        {
          step: "Listed all frames",
          progress: `${frames.length} frames`,
          nextStep: "Use get_frame_info(frame_name) for structure, or extract_assets for icons/images",
        }
      );
    
      return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] };
    }
  • Input schema and description for the list_frames tool, defining required parameters (file_key, page_name) and optional continue flag.
      {
        name: "list_frames",
        description: `List frames/screens in a specific page.
    
    HOW IT WORKS:
    - Search by page name (partial match supported)
    - Large pages (>50 frames) are automatically chunked
    - Returns compact list with frame names, sizes, and IDs
    - Session remembers what was sent
    
    TYPICAL WORKFLOW:
    1. list_pages → find page name
    2. list_frames(page_name) → see frames
    3. get_frame_info(frame_name) → detail one frame
    4. extract_assets(frame_name) → get assets`,
        inputSchema: {
          type: "object",
          properties: {
            file_key: { type: "string", description: "Figma file key" },
            page_name: { type: "string", description: "Page name (partial match, case-insensitive)" },
            continue: { type: "boolean", description: "Continue from last response if more frames available" },
          },
          required: ["file_key", "page_name"],
        },
      },
  • src/index.js:48-50 (registration)
    Dispatch in the main MCP server request handler (CallToolRequestSchema) that routes 'list_frames' calls to the listFrames handler function.
    case "list_frames":
      result = await handlers.listFrames(this.ctx, args.file_key, args.page_name, args.continue);
      break;
  • Re-export of the listFrames handler from navigation.js, allowing it to be imported as part of the handlers module.
    export { listPages, listFrames, getFrameInfo } from "./navigation.js";
Behavior4/5

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

With no annotations provided, the description carries the full burden and adds valuable behavioral context beyond the schema: it explains partial matching for page names, automatic chunking for large pages (>50 frames), the return format ('compact list with frame names, sizes, and IDs'), and session persistence ('Session remembers what was sent'). It doesn't cover error cases or rate limits, but provides substantial operational details.

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 well-structured with clear sections ('HOW IT WORKS', 'TYPICAL WORKFLOW') and front-loaded with the core purpose. Each sentence adds value, though the workflow section is somewhat lengthy; it could be slightly more concise while retaining clarity.

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

Completeness4/5

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

Given no annotations and no output schema, the description does a good job of covering key aspects: purpose, usage guidelines, behavioral traits, and parameter context. It explains the return format and session behavior, which compensates for the lack of output schema. However, it doesn't detail error handling or authentication needs, leaving minor gaps.

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?

Schema description coverage is 100%, so the schema already documents all three parameters. The description adds some context: it mentions partial match support for 'page_name' (implied in schema but reinforced) and explains the purpose of 'continue' in relation to chunking. However, it doesn't provide significant additional meaning beyond what the schema offers, meeting the baseline for high coverage.

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 specific action ('List frames/screens'), target resource ('in a specific page'), and distinguishes from siblings like 'list_pages' (which lists pages) and 'get_frame_info' (which provides detailed info on a single frame). The opening sentence is precise and unambiguous.

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

Usage Guidelines5/5

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

The 'TYPICAL WORKFLOW' section explicitly provides step-by-step guidance on when to use this tool versus alternatives: first use 'list_pages' to find a page name, then 'list_frames' to see frames, followed by 'get_frame_info' for details or 'extract_assets' for assets. This clearly defines the tool's role in the workflow.

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/alucardeht/figma-mcp'

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