Skip to main content
Glama

get_image_fills

Retrieve image URLs from Figma files to access embedded graphics and visual assets for external use or integration.

Instructions

Get URLs for images used in a Figma file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileKeyYesThe key of the file to get image fills from

Implementation Reference

  • The main handler function that implements the get_image_fills tool logic by making an authenticated request to the Figma API endpoint `/files/{fileKey}/images` to retrieve URLs for images used as fills in the file.
    async getImageFills(args: GetImageFillsArgs) {
      const { fileKey } = args;
      
      return this.api.makeRequest(`/files/${fileKey}/images`);
    }
  • TypeScript interface defining the input arguments for the get_image_fills tool: requires a 'fileKey' string.
    export interface GetImageFillsArgs {
      fileKey: string;
    }
  • src/index.ts:207-220 (registration)
    Registers the 'get_image_fills' tool in the MCP server's tool list, including name, description, and input schema for validation.
    {
      name: 'get_image_fills',
      description: 'Get URLs for images used in a Figma file',
      inputSchema: {
        type: 'object',
        properties: {
          fileKey: {
            type: 'string',
            description: 'The key of the file to get image fills from'
          }
        },
        required: ['fileKey']
      },
    },
  • src/index.ts:514-520 (registration)
    Dispatch handler in the CallToolRequest that validates arguments and delegates execution to the filesHandler.getImageFills method.
    case 'get_image_fills': {
      const args = this.validateArgs<GetImageFillsArgs>(request.params.arguments, ['fileKey']);
      const result = await this.filesHandler.getImageFills(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }

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