Skip to main content
Glama

craftos_test

Run *.test.lua files in fresh ComputerCraft emulators to test Lua programs with ccunit, returning pass counts, failures, and error lines.

Instructions

Run *.test.lua files. Inside a test file use the global ccunit: test(name, fn [, {timeout}]), eq, neq, near, contains, truthy, raises(fn, pattern), skip, and run(program, {seconds|script, args}) / screen(monitor?) / touch(monitor, x, y) to drive a program and read its screens (craftos_help {topic:"ccunit"}). Each file runs in its own fresh computer; peripherals can be attached with "monitors". timeoutMs is per file and covers copying the workspace; a file that hangs keeps the tests it finished and names the one it was in. The reply gives each file its status, a count of passing tests (named too in runs of up to 50 tests), and every failing test with its error and line. 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

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "craftos_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsNoFiles or directories; empty runs every *.test.lua.
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.
budgetMsNoReal time for the whole call (default 10 min). When it runs out, running files stop keeping their finished tests, and notRun lists the rest.
monitorsNo
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.
timeoutMsNo
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare openWorldHint=false and destructiveHint=false, yet the description discloses real behavior: each file gets a fresh computer, `timeoutMs` is per file and includes workspace copying, a hung file retains finished tests and names the test it was in, and the workspace copy excludes .git, node_modules, .runtime and gitignored paths. It also describes the reply shape (status per file, pass counts, failures with error and line).

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?

The purpose is front-loaded in the first clause, and each subsequent sentence carries real information (isolation model, timeout behavior, reply format, workspace copy rules). It is dense and parenthetical-heavy, with several help-pointer digressions that could be trimmed, but no sentence is 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 a 7-parameter tool with a free-form nested `world` object and no output schema, the description covers the essentials an agent needs: which files run, isolation and peripheral setup, timeout/budget interplay, workspace copying cost, and the structure of the reply. Remaining gaps (timeScale, budgetMs, worldFile) are documented in the schema itself.

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 coverage is 71%, and the text adds genuine meaning beyond the schema for the highest-risk parameters: `world.deploy` semantics for selective workspace copying, `monitors` as the mechanism for attaching peripherals to the fresh computer, and `timeoutMs` being per-file and inclusive of copy time. It says nothing about `budgetMs`, `timeScale` or `worldFile`, leaving those entirely to the schema.

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 opening verb+resource is concrete: run `*.test.lua` files via the `ccunit` global, which is clearly a test-execution tool rather than a general program runner. It does not name or contrast with the plausible alternatives (craftos_run, craftos_script), so an agent must infer the boundary from the file glob alone.

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

Usage Guidelines4/5

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

Usage is well-framed: point it at test files, use an empty `paths` to run everything, use `world.deploy` for big workspaces so only some folders are copied, and consult craftos_help {topic:"ccunit"} for the in-test API. It stops short of explicit exclusions such as when to prefer craftos_run or craftos_script instead.

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