Skip to main content
Glama

get_file_nodes

Retrieve specific design elements from a Figma file using node IDs to access components, layers, or frames for analysis or integration.

Instructions

Get specific nodes from a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileKeyYesThe key of the file to get nodes from
node_idsYesArray of node IDs to get
depthNoOptional. Depth of nodes to return (1-4)
versionNoOptional. A specific version ID to get

Implementation Reference

  • The core handler function getFileNodes that executes the tool logic by calling the Figma API /files/{fileKey}/nodes endpoint with joined node_ids.
    async getFileNodes(args: GetFileNodesArgs) {
      const { fileKey, node_ids, ...otherParams } = args;
      
      const params: Record<string, string | number | boolean | undefined> = {
        ...otherParams,
        ids: node_ids.join(',')
      };
    
      return this.api.makeRequest(`/files/${fileKey}/nodes${this.api.buildQueryString(params)}`);
    }
  • src/index.ts:141-166 (registration)
    Tool registration in the list of tools provided by the MCP server, including name, description, and input schema.
      name: 'get_file_nodes',
      description: 'Get specific nodes from a Figma file',
      inputSchema: {
        type: 'object',
        properties: {
          fileKey: {
            type: 'string',
            description: 'The key of the file to get nodes from'
          },
          node_ids: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of node IDs to get'
          },
          depth: {
            type: 'number',
            description: 'Optional. Depth of nodes to return (1-4)'
          },
          version: {
            type: 'string',
            description: 'Optional. A specific version ID to get'
          }
        },
        required: ['fileKey', 'node_ids']
      },
    },
  • src/index.ts:498-504 (registration)
    Dispatch logic in the CallToolRequestHandler switch statement that handles 'get_file_nodes' tool calls by validating args and invoking the filesHandler.
    case 'get_file_nodes': {
      const args = this.validateArgs<GetFileNodesArgs>(request.params.arguments, ['fileKey', 'node_ids']);
      const result = await this.filesHandler.getFileNodes(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • TypeScript interface defining the input arguments for the get_file_nodes tool.
    export interface GetFileNodesArgs extends BaseParams {
      fileKey: string;
      node_ids: string[];
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, the description doesn't address authentication requirements, rate limits, error conditions, or what format the returned nodes will have. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a straightforward retrieval tool and gets directly to the point.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'nodes' represent in Figma context, what the response format will be, or any behavioral constraints. The agent would need to guess about important operational aspects.

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?

With 100% schema description coverage, the input schema already documents all four parameters thoroughly. The description adds no additional parameter context beyond what's in the schema, so it meets the baseline expectation but doesn't provide extra value.

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 action ('Get') and resource ('specific nodes from a Figma file'), making the tool's purpose immediately understandable. However, it doesn't distinguish this tool from similar siblings like 'get_file' or 'get_component', which also retrieve Figma file elements, so it doesn't reach the highest clarity level.

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. With siblings like 'get_file' (for entire files) and 'get_component' (for specific components), the agent has no indication whether this tool is for general node retrieval, filtered queries, or other specific use cases.

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

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