agentskit.js
ToolsIntegrations

figma

Figma — read file node tree and export node ids as image URLs. Personal access token.

import { figma } from '@agentskit/tools/integrations'

const tools = figma({ accessToken: process.env.FIGMA_TOKEN! })

Bundled: figma(config) returns both sub-tools. Calls Figma REST API v1 at https://api.figma.com/v1.

#Sub-tools

NamePurpose
figma_get_fileRead a Figma file — returns name, lastModified, and top-level node tree
figma_export_imagesExport node IDs as image URLs in jpg / png / svg / pdf

#Schema

#figma_get_file

ParameterTypeRequiredDescription
fileKeystringyesThe file key from the Figma URL (figma.com/file/<key>/...)
depthnumbernoLimit node-tree traversal depth

#figma_export_images

ParameterTypeRequiredDescription
fileKeystringyesFigma file key
idsstring[]yesNode IDs to export
formatstringnojpg | png | svg | pdf (default png)
scalenumbernoExport scale factor (default 2)

#Example — design-to-spec agent

import { createRuntime } from '@agentskit/runtime'
import { figma } from '@agentskit/tools/integrations'

const runtime = createRuntime({
  adapter,
  systemPrompt: 'You extract design specs from Figma files and produce developer handoff notes.',
  tools: figma({ accessToken: process.env.FIGMA_TOKEN! }),
})

await runtime.run('Read the top-level frames of file abc123 and summarize the page layout.')

#Security

  • Env var required: FIGMA_TOKEN — a Figma personal access token (Settings → Security → Personal access tokens).
  • Tokens have view-only or edit scope; agents only need view scope (file:read).
  • Figma enforces rate limits per token; avoid polling on short intervals. The figma_get_file response includes lastModified — use it to skip fetches when files have not changed.
  • Export URLs returned by figma_export_images are temporary (expire within minutes); download and store them if you need persistence.

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page

Ask the docs

Ask anything about AgentsKit. Answers come from the docs corpus via OpenRouter free-tier models. Rate limited per IP.