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
| Name | Required | Description | Default |
|---|---|---|---|
| fileKey | Yes | The key of the file to get image fills from |
Implementation Reference
- src/handlers/files.ts:54-58 (handler)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`); }
- src/types/files.ts:23-25 (schema)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) }], }; }