Skip to main content
Glama

run

Destructive

Execute a Pyxel script headlessly for a frame budget or until a condition holds, with scheduled inputs and state, screen, or video snapshots for verification.

Instructions

Run a Pyxel script headlessly for a frame budget or until a condition holds, with scheduled input and state, screen, or video capture. screen_image snapshots with inline=true also return the PNG as image content, and a single inline frame may omit its output path.

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": {
      "script": "<script>",
      "frames": "<frames>"
    },
    "name": "run"
  }
}

Input Schema

NameRequiredDescriptionDefault
untilNo
framesYes
inputsNo
scriptYes
timeoutNo
snapshotsNo
random_seedNo
stall_window_framesNo

Output Schema

NameRequiredDescriptionDefault
okYes
logYes
errorsYes
seededYes
snapshotsYes
until_metNoTrue once `until` held, False when it was evaluated without ever holding, None when it was never evaluated.
exit_statusYesok includes reaching the frame budget, matching until, or an explicit pyxel.quit(). Cleanup failures are reported as crashed.
frame_countYesNumber of completed update/draw pairs; excludes a partial quit frame.
elapsed_secondsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.5.0
    • addedInput schema / $defs / InputEvent / properties / dropped_files
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "File names delivered on this frame.",
      +  "title": "Dropped Files"
      +}
    • addedInput schema / $defs / InputEvent / properties / input_text
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Text entered on this frame.",
      +  "title": "Input Text"
      +}
    • addedInput schema / $defs / InputEvent / properties / mouse_wheel
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxItems": 2,
      +      "minItems": 2,
      +      "prefixItems": [
      +        {
      +          "type": "integer"
      +        },
      +        {
      +          "type": "integer"
      +        }
      +      ],
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Horizontal and vertical wheel deltas for this frame.",
      +  "title": "Mouse Wheel"
      +}
  2. Changed2 schema fields changedv1.3.1
    • addedOutput schema / properties / exit_status / description
      Added value: +"ok includes reaching the frame budget, matching until, or an explicit pyxel.quit(). Cleanup failures are reported as crashed."
    • addedOutput schema / properties / frame_count / description
      Added value: +"Number of completed update/draw pairs; excludes a partial quit frame."
  3. Addedv1.3.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already disclose destructiveHint=true, idempotentHint=false and openWorldHint=true, so the safety profile is covered. The description adds genuinely new behavior beyond that — headless execution, frame budget/until termination, scheduled input, state/screen/video capture, and inline PNG content with temp-dir fallback for missing output paths. It still omits that runs write files to disk and says nothing about the timeout or stall-window guards that bound a destructive execution.

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

Conciseness5/5

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

Two tightly packed sentences with the primary action and termination modes front-loaded, followed by the one non-obvious capture nuance (inline PNG, omitted output path). Nothing is repeated from the schema or annotations.

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

Completeness3/5

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

An output schema exists so return values need not be explained, and the snapshot kinds are named. But for a destructive, eight-parameter execution tool with a nested discriminated snapshot union, the description leaves timeout, random_seed, stall_window_frames and the on-disk side effects unexplained.

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

Parameters3/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 compensate, and it does for roughly half the surface: frames (frame budget), until (condition), inputs (scheduled input), snapshots (state/screen/video capture), and the inline/output interaction. It adds nothing about script, timeout, random_seed, or stall_window_frames, leaving several parameters meaningful only by name.

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?

The description states a specific verb and resource ('Run a Pyxel script headlessly') plus the two termination modes ('frame budget or until a condition holds'), so the agent knows exactly what execution semantics to expect. It does not explicitly contrast with siblings such as validate or diff_frames, which keeps it from a 5.

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?

Usage context is implied rather than stated: it is the tool that actually executes a script, and the phrase 'for a frame budget or until a condition holds' hints at the two run modes, but there is no explicit when-to-use/when-not or routing to alternatives like validate or diff_frames.

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