Opentoonz Run Script
opentoonz_run_scriptExecute custom OpenToonz JavaScript headlessly to automate scene, level, cell, and image operations when built-in MCP tools are insufficient.
Instructions
Run arbitrary OpenToonz JavaScript headlessly (the full-power escape hatch).
The script can use the OpenToonz API: new Scene(path?), scene.newLevel(type, name), scene.loadLevel(name, "path/..png"), scene.setCell(row, col, level, fid), scene.getCell(row, col), scene.getLevels(), scene.save(path), new Image(path), image.save(path), level.setFrame(fid, image). Use print() for output; stdout is returned. Do NOT use new Renderer() — renderFrame deadlocks in CLI mode; use opentoonz_render instead. Use absolute paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| timeout | No | ||
| workspace | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |