Skip to main content
Glama

craftos_run

Run a workspace Lua program in a fresh CC:Tweaked emulator, attach monitors if needed, and return exit status, terminal and monitor output, and error details.

Instructions

Run a workspace program in a fresh emulated CC:Tweaked computer, optionally with monitors attached, and return its exit status (completed, program_failed, timed_out) plus the final text of the terminal and every monitor; a failed program also gets error {kind, message, file, line}. Set screenshots to also get PNG images. Pass snapshot to compare the screens against a golden file. timeoutMs covers copying the workspace too; a run that outlasts it comes back with status timed_out (normal for a program that waits for input forever). The computer gets a copy of the workspace (without .git, node_modules, .runtime and what .gitignore ignores); for a big workspace give world.deploy to copy only some folders.

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": {
      "program": "<program>"
    },
    "name": "craftos_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoThe program's arguments.
scaleNoPNG pixels per screen pixel.
worldNoThe world around the computer (an object). Fields: addons, version, simProgram, craftosPcApis, motd, players, host, interacting, autoApprove, economyAvailable, holdInteraction, vhcctweaks, economyDelayTicks, gearPowerAvailable, identifyAvailable, internalErrors, vhccStore, linkLatency, computerId, kind, advanced, terminal, config, position, cobaltSpeed, label, deploy, peripherals, environment, entities, ap, mekanism, turtle, disks, blocks, fills, ground, items, gameRules, turtleConfig, spawnProtection, worldBorder, loadedChunks, unloadedChunks, nextDiskId, gameData, seed; e.g. {"peripherals":[{"name":"chest_0","type":"minecraft:chest","size":27}],"deploy":[{"from":"src"}]}. world.deploy picks which workspace folders or files go on the computer, and where ([{"from":"src","to":"lib"}]), instead of a copy of the whole workspace. Every field with its options: craftos_help {topic:"world"} (or the craftos://schema/world resource). Checked before boot: a wrong key or peripheral type comes back as an error with a suggestion.
programYesWorkspace-relative path, e.g. "hello.lua" (as on the computer, so a deploy list's target path).
monitorsNoMonitors attached before it starts.
snapshotNoCompare final screens with __snapshots__/<name>.json (created on first use).
timeScaleNoVirtual clock speed. 10 makes sleep(), os.clock() and os.epoch() run 10x faster than real time, so slow scripts finish quickly. timeoutMs stays in real time.
timeoutMsNoReal time before the run stops as timed_out.
worldFileNoA saved world: a name in the worlds folder (e.g. "advanced-peripherals-demo") or a workspace path to a .json file (e.g. "door.world.json"). Fields in `world` override it.
fullScreensNoKeep every line, trailing blank ones too (default: lines stop at the last non-blank one).
screenshotsNoAlso return a PNG of every screen.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.1/5.0
Behavior5/5

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

With only openWorldHint=false and destructiveHint=false in annotations, the description carries the behavioral burden and does so: exit status enumerations, the {kind, message, file, line} error shape, terminal and monitor text output, and the timeoutMs caveat that it also covers workspace copying. It further discloses the workspace snapshot rules (excludes .git, node_modules, .runtime, .gitignore matches), which is exactly the kind of side-effect detail an agent needs before running a program.

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 the action, and the remaining sentences each address a distinct concern (returns, optional outputs, timeout semantics, workspace copy). The first sentence is long and multi-clause, and some option descriptions restate the schema, but no sentence is pure filler.

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

Completeness5/5

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

For an 11-parameter tool with a nested world object and no output schema, the description supplies the missing return contract, timeout behavior, and filesystem side effects. It also routes the agent to craftos_help for world field details, so nothing an agent needs in order to call it correctly is absent.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description earns above that by explaining that timeoutMs covers copying as well as execution and by recommending world.deploy for large workspaces. It also clarifies the snapshot golden-file workflow and pointer to craftos_help {topic:"world"} for the nested world object, which is more than the schema alone conveys.

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+resource+scope: 'Run a workspace program in a fresh emulated CC:Tweaked computer, optionally with monitors attached.' The word 'fresh' implicitly distinguishes it from session-based siblings, and the return contract is spelled out. It never names an alternative, so the sibling differentiation is inferential rather than explicit.

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?

Gives conditional usage for several options ('Set screenshots to also get PNG images', 'Pass snapshot to compare', 'for a big workspace give world.deploy') and normalizes the timeout outcome ('normal for a program that waits for input forever'). It never says when to pick this over craftos_script, craftos_test, or a persistent session, so the when-to-use framing stays implied.

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