figma_get_file_meta
Retrieve metadata for a Figma file by providing its unique file key and personal access token. Streamline design file analysis and integration.
Instructions
Get metadata information for a Figma file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileKey | Yes | Unique identifier of the Figma file | |
| personalToken | No | Your Figma personal access token |
Implementation Reference
- src/server/figma/tools/figma.ts:95-114 (registration)Registration of the figma_get_file_meta tool (commented out), including Zod input schema, description, and inline handler that calls api.meta(o).// server.tool( // 'figma_get_file_meta', // 'Get metadata information for a Figma file', // { // fileKey: z.string().describe('Unique identifier of the Figma file'), // personalToken: z.string().optional().describe('Your Figma personal access token'), // }, // async (o): Promise<CallToolResult> => { // try { // const data = await api.meta(o) // return { // content: [{type: 'text', text: JSON.stringify(data)}], // } // } catch (error: any) { // return { // content: [{type: 'text', text: `Error: ${error.message}`}], // } // } // }, // )
- src/server/figma/tools/figma.ts:102-113 (handler)Tool handler function: invokes api.meta(o), stringifies the result as JSON text, or returns error message.// async (o): Promise<CallToolResult> => { // try { // const data = await api.meta(o) // return { // content: [{type: 'text', text: JSON.stringify(data)}], // } // } catch (error: any) { // return { // content: [{type: 'text', text: `Error: ${error.message}`}], // } // } // },
- src/server/figma/apis/figma.ts:28-32 (helper)Helper method in FigmaRestApi class that constructs the /files/{fileKey}/meta URL and fetches the metadata using the configured token.// Returns the metadata for the file referred to by :key async meta(o: GetKeyParams) { const url = this.opToUrl(`${this.figmaHost}/files/${o.fileKey}/meta`, o) return this.fetch(url) }
- TypeScript interface defining parameters for the meta API: required fileKey and optional personalToken.export interface GetKeyParams { fileKey: string personalToken?: string }