figma_run_script
Execute arbitrary JavaScript in the Figma Plugin API context to read or modify the open file; large results are written to a file.
Instructions
Run arbitrary JavaScript in the plugin with the figma Plugin API global (top-level await, use return). Can read AND modify the open file. Large results are written to a file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "figma_run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Body of an async function; `figma` is in scope |