Session and console¶
figma_list_open_files¶
Shows every Figma file the plugin is currently running in, and which of them is active. Useful when several files are open and commands go to the wrong one.
Takes no parameters.
JSON Schema
{
"type": "object",
"properties": {}
}
figma_navigate¶
Selects the file the following commands will go to. It accepts a link to a Figma file or its key. lockTarget=true pins the target: then the user switching files will not move it — needed when an agent and a human work in different files at the same time.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
fileUrlOrKey |
string |
yes | — | Link to the Figma file or its key. |
lockTarget |
boolean |
— | false |
Pin the target to the agent. |
JSON Schema
{
"type": "object",
"properties": {
"fileUrlOrKey": {
"description": "Link to the Figma file or its key.",
"type": "string"
},
"lockTarget": {
"description": "Pin the target to the agent.",
"type": "boolean",
"default": false
}
},
"required": [
"fileUrlOrKey"
]
}
figma_execute_across_files¶
Runs the same JavaScript IN SEVERAL Figma files AT ONCE — in parallel, without touching the active file or the pinned target. For auditing and editing across a multi-file design system: one check runs over every file and the results are compared with each other — instead of switching the active file and calling figma_execute one by one. In every file the code runs in that file's own plugin sandbox, with the same figma object as figma_execute. The targets must be named explicitly: fileKeys (the list from figma_list_open_files) or allFiles=true. Requires a running plugin in every target file.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
code |
string |
yes | — | JavaScript code, the same as in figma_execute. Example: return figma.root.children.length; |
fileKeys |
string? |
— | null |
Comma-separated keys of the target files. They come from figma_list_open_files. |
allFiles |
boolean |
— | false |
Run it over EVERY connected file. Requires explicit consent: the code will reach the pinned file too. |
timeoutMs |
integer |
— | 10000 |
Per-file timeout in milliseconds, at most 30000. A slow file does not hold the others back. |
JSON Schema
{
"type": "object",
"properties": {
"code": {
"description": "JavaScript code, the same as in figma_execute. Example: return figma.root.children.length;",
"type": "string"
},
"fileKeys": {
"description": "Comma-separated keys of the target files. They come from figma_list_open_files.",
"type": [
"string",
"null"
],
"default": null
},
"allFiles": {
"description": "Run it over EVERY connected file. Requires explicit consent: the code will reach the pinned file too.",
"type": "boolean",
"default": false
},
"timeoutMs": {
"description": "Per-file timeout in milliseconds, at most 30000. A slow file does not hold the others back.",
"type": "integer",
"default": 10000
}
},
"required": [
"code"
]
}
figma_reconnect¶
Releases the pinned target and re-reads the list of connected files. Call it when the server keeps aiming at a file that is already closed.
Takes no parameters.
JSON Schema
{
"type": "object",
"properties": {}
}
figma_reload_plugin¶
Reloads the plugin UI in Figma. It helps when the plugin stopped answering. Requires the plugin.
Takes no parameters.
JSON Schema
{
"type": "object",
"properties": {}
}
figma_get_console_logs¶
The latest console lines from the plugin sandbox. Needed to understand why figma_execute failed or what exactly the plugin did.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit |
integer |
— | 50 |
How many of the latest lines to return. |
level |
string? |
— | null |
Keep only the lines of this level: log, info, warn, error. |
JSON Schema
{
"type": "object",
"properties": {
"limit": {
"description": "How many of the latest lines to return.",
"type": "integer",
"default": 50
},
"level": {
"description": "Keep only the lines of this level: log, info, warn, error.",
"type": [
"string",
"null"
],
"default": null
}
}
}
figma_clear_console¶
Clears the console buffer, both on the server and in the plugin. Handy before a new figma_execute run.
Takes no parameters.
JSON Schema
{
"type": "object",
"properties": {}
}
figma_watch_console¶
Waits for new lines to appear in the plugin console up to the given timeout. Needed when an edit runs asynchronously and the result arrives with a delay.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
timeoutSeconds |
integer |
— | 10 |
How many seconds to wait for new lines. |
minEntries |
integer |
— | 1 |
Wait for at least this many new lines. |
JSON Schema
{
"type": "object",
"properties": {
"timeoutSeconds": {
"description": "How many seconds to wait for new lines.",
"type": "integer",
"default": 10
},
"minEntries": {
"description": "Wait for at least this many new lines.",
"type": "integer",
"default": 1
}
}
}
figma_export_node¶
Exports a node through the live editor: SVG returns the markup itself, PDF/PNG/JPG are saved to disk and the path is returned. No REST quota is spent — this replaces the paid /v1/images render for files open in Figma Desktop. Requires the plugin.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
nodeId |
string |
yes | — | Node id; a page id works too. |
format |
string |
— | SVG |
Format: SVG, PDF, PNG or JPG. |
scale |
number |
— | 1 |
Render scale for PNG and JPG. |
JSON Schema
{
"type": "object",
"properties": {
"nodeId": {
"description": "Node id; a page id works too.",
"type": "string"
},
"format": {
"description": "Format: SVG, PDF, PNG or JPG.",
"type": "string",
"default": "SVG"
},
"scale": {
"description": "Render scale for PNG and JPG.",
"type": "number",
"default": 1
}
},
"required": [
"nodeId"
]
}
figma_get_active_users¶
Who is in the file right now: the token owner (me) and the other live collaborators with their multiplayer colors. Useful before heavy mutations — a human working in the same file deserves figma_commit_undo batches and gentler pacing. Requires the plugin.
Takes no parameters.
JSON Schema
{
"type": "object",
"properties": {}
}
figma_notify¶
Shows a toast inside the Figma window — the way to tell the human at the canvas that a batch of work is done or needs their eyes. Requires the plugin.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
message |
string |
yes | — | Toast text shown in the Figma window. |
timeoutMs |
integer |
— | 4000 |
How long it stays, in milliseconds. |
isError |
boolean |
— | false |
Style the toast as an error. |
JSON Schema
{
"type": "object",
"properties": {
"message": {
"description": "Toast text shown in the Figma window.",
"type": "string"
},
"timeoutMs": {
"description": "How long it stays, in milliseconds.",
"type": "integer",
"default": 4000
},
"isError": {
"description": "Style the toast as an error.",
"type": "boolean",
"default": false
}
},
"required": [
"message"
]
}
figma_scroll_to_node¶
Scrolls the user's viewport to a node, switching pages when needed; select=true also selects it. Call it after creating something so the human sees the result without hunting for it. Requires the plugin.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
nodeId |
string |
yes | — | Node id to bring into view. |
select |
boolean |
— | false |
Also select the node. |
zoom |
number? |
— | null |
Zoom level after centering; empty keeps the fitted zoom. |
JSON Schema
{
"type": "object",
"properties": {
"nodeId": {
"description": "Node id to bring into view.",
"type": "string"
},
"select": {
"description": "Also select the node.",
"type": "boolean",
"default": false
},
"zoom": {
"description": "Zoom level after centering; empty keeps the fitted zoom.",
"type": [
"number",
"null"
],
"default": null
}
},
"required": [
"nodeId"
]
}
figma_set_file_thumbnail¶
Makes a frame the file cover shown in the project browser; an empty nodeId resets to the default. Requires the plugin.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
nodeId |
string? |
— | null |
Node whose render becomes the file cover; empty resets to the default. |
JSON Schema
{
"type": "object",
"properties": {
"nodeId": {
"description": "Node whose render becomes the file cover; empty resets to the default.",
"type": [
"string",
"null"
],
"default": null
}
}
}
figma_take_screenshot¶
Captures a node or the current page straight from the plugin. Unlike figma_get_component_image, it shows the state RIGHT NOW, including edits made a moment ago — so this is the tool that verifies the result of a mutation. The picture does not come back as base64 in the response (that overflows the tool limit on large captures) — it is saved to disk, and the response carries the file path (image.path) and the metadata. Open the file at that path to see the picture. Requires the plugin.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
nodeId |
string? |
— | null |
Node id. Empty captures the current page. |
format |
string |
— | PNG |
Format: PNG (the default), JPG, SVG. |
scale |
number |
— | 1 |
Render scale. |
JSON Schema
{
"type": "object",
"properties": {
"nodeId": {
"description": "Node id. Empty captures the current page.",
"type": [
"string",
"null"
],
"default": null
},
"format": {
"description": "Format: PNG (the default), JPG, SVG.",
"type": "string",
"default": "PNG"
},
"scale": {
"description": "Render scale.",
"type": "number",
"default": 1
}
}
}
figma_get_text_styles¶
The text styles of a file read through the plugin: name, size, weight, line height. Requires the plugin.
Takes no parameters.
JSON Schema
{
"type": "object",
"properties": {}
}