Skip to main content
Glama

figma_get_images

Extract images from Figma nodes by specifying file key, node IDs, format, scale, and other parameters. Supports formats like PNG, JPG, SVG, and PDF for efficient design asset retrieval.

Instructions

Get images of Figma nodes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileKeyYesUnique identifier of the Figma file
formatNoImage format, e.g., png, jpg, svg
idsYesNode IDs to get images for, comma separated
personalTokenNoYour Figma personal access token
scaleNoImage scale factor
svg_include_idNoWhether SVG includes ID
svg_simplify_strokeNoWhether to simplify SVG strokes
use_absolute_boundsNoWhether to use absolute bounds
versionNoSpecify the version to return

Implementation Reference

  • Handler function that executes the tool logic by calling api.images(o) and formatting the response as text content or error.
    async (o): Promise<CallToolResult> => {
      try {
        const data = await api.images(o)
    
        return {
          content: [{type: 'text', text: JSON.stringify(data)}],
        }
      } catch (error: any) {
        return {
          content: [{type: 'text', text: `Error: ${error.message}`}],
        }
      }
    },
  • Registration of the figma_get_images tool on the MCP server, specifying name, description, input schema, and handler function.
      'figma_get_images',
      'Get images of Figma nodes',
      {
        fileKey: z.string().describe('Unique identifier of the Figma file'),
        ids: z.string().describe('Node IDs to get images for, comma separated'),
        format: z.enum(['jpg', 'png', 'svg', 'pdf']).optional().describe('Image format, e.g., png, jpg, svg'),
        scale: z.number().optional().describe('Image scale factor'),
        svg_include_id: z.boolean().optional().describe('Whether SVG includes ID'),
        svg_simplify_stroke: z.boolean().optional().describe('Whether to simplify SVG strokes'),
        use_absolute_bounds: z.boolean().optional().describe('Whether to use absolute bounds'),
        version: z.string().optional().describe('Specify the version to return'),
        personalToken: z
          .string()
          .optional()
          .describe('Your Figma personal access token, The parameters are not required when the tool is called.'),
      },
      async (o): Promise<CallToolResult> => {
        try {
          const data = await api.images(o)
    
          return {
            content: [{type: 'text', text: JSON.stringify(data)}],
          }
        } catch (error: any) {
          return {
            content: [{type: 'text', text: `Error: ${error.message}`}],
          }
        }
      },
    )
  • Zod input validation schema for the tool parameters.
    {
      fileKey: z.string().describe('Unique identifier of the Figma file'),
      ids: z.string().describe('Node IDs to get images for, comma separated'),
      format: z.enum(['jpg', 'png', 'svg', 'pdf']).optional().describe('Image format, e.g., png, jpg, svg'),
      scale: z.number().optional().describe('Image scale factor'),
      svg_include_id: z.boolean().optional().describe('Whether SVG includes ID'),
      svg_simplify_stroke: z.boolean().optional().describe('Whether to simplify SVG strokes'),
      use_absolute_bounds: z.boolean().optional().describe('Whether to use absolute bounds'),
      version: z.string().optional().describe('Specify the version to return'),
      personalToken: z
        .string()
        .optional()
        .describe('Your Figma personal access token, The parameters are not required when the tool is called.'),
    },
  • Helper function implementing the Figma API call for retrieving images by constructing the endpoint URL and fetching the data.
    async images(o: GetImagesParams) {
      const url = this.opToUrl(`${this.figmaHost}/images/${o.fileKey}`, o)
      return this.fetch(url)
    }
  • TypeScript type definition for input parameters matching the tool schema.
    export interface GetImagesParams {
      fileKey: string
      ids: string
      scale?: number
      format?: 'jpg' | 'png' | 'svg' | 'pdf'
      svg_include_id?: boolean
      svg_simplify_stroke?: boolean
      use_absolute_bounds?: boolean
      version?: string
      personalToken?: string
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does ('Get images'), without mentioning authentication needs (implied by the personalToken parameter), rate limits, response format, or whether it's a read-only operation. For a tool with 9 parameters and no annotation coverage, this is inadequate.

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 with zero waste. It's front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly without unnecessary elaboration.

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 the tool's complexity (9 parameters, no annotations, no output schema), the description is incomplete. It doesn't address authentication, rate limits, error handling, or how the output is structured (e.g., image URLs or binary data). For a tool that likely involves API calls and image retrieval, more context is needed to guide effective use.

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 schema description coverage is 100%, meaning all parameters are documented in the input schema. The description adds no additional meaning beyond the schema, such as explaining relationships between parameters (e.g., how 'scale' affects image quality) or usage examples. With high schema coverage, the 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 'Get images of Figma nodes' clearly states the verb ('Get') and resource ('images of Figma nodes'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'figma_get_image_fills' or 'figma_get_file_data', which also retrieve visual data from Figma files, so it lacks sibling differentiation.

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. It doesn't mention context, prerequisites, or exclusions, leaving the agent to infer usage from the tool name and parameters alone. This is a significant gap given sibling tools like 'figma_get_image_fills' that might overlap in functionality.

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

Related 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/f2c-ai/f2c-mcp'

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