Skip to main content
Glama

Opentoonz Run Script

opentoonz_run_script

Execute 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

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo
workspaceYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and delivers key operational facts: execution is headless, print() output is returned via stdout, absolute paths are required, and new Renderer() deadlocks in CLI mode. It omits timeout behavior and sandbox/permission scope, but the deadlock caveat and stdout contract are genuinely valuable disclosures beyond any structured field.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and the escape-hatch framing, followed by a dense but useful API reference and critical warnings. Every element earns its place, though the inline API method list makes it dense.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an arbitrary-code-execution tool with an output schema already covering return values, the description supplies the API surface, output mechanism, and the critical Renderer deadlock warning. The remaining gap is that required parameters like workspace are left unexplained, but overall coverage of what an agent needs to call it correctly is strong.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain the three parameters, but it only implies the semantics of 'code' (JS + API surface) and never addresses 'workspace' or 'timeout'. Two of three parameters remain undocumented anywhere.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Run arbitrary OpenToonz JavaScript headlessly,' and frames itself as 'the full-power escape hatch,' which signals its relationship to the specialized sibling tools. It also explicitly routes away from opentoonz_render, so an agent can differentiate it from at least one sibling without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides one explicit when-not rule (avoid new Renderer(), use opentoonz_render instead) and frames itself as the general escape hatch, but never states the broader condition of when to prefer this over the purpose-built siblings like opentoonz_set_cells or opentoonz_draw_frame. Usage is implied rather than spelled out.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.