Run Lua tests
tests_runRuns GLuaTest files in a chosen realm and returns structured pass/fail results, so you can validate Lua code without leaving the game.
Instructions
Runs test files in GLuaTest format in one realm and returns structured results. A file returns {groupName, beforeAll, beforeEach, afterEach, afterAll, cases = {{name, func, skip?, when?, timeout?}}}; inside, expect(x).to.equal(y) / .notTo / .beTrue / .beNil / .exist / .beA(type) / .beValid / .beGreaterThan / .beLessThan / .beBetween / .aboutEqual(x, tol) / .haveLength / .contain / .err / .errWith(msg) / .succeed. Steps share a state table (their first argument). path: a file or a pattern in the file name (*.lua, or **/.lua for subfolders), relative to lua/mcpagent_tmp/ or absolute. Result: {files: [{file, group, cases: [{name, status: pass|fail|error|skip, message?, line?, traceback?, duration_ms}], error?, setup_error?}], totals {pass, fail, error, skip}, ok}. The whole run is one call on the main thread (the game is frozen meanwhile): for multi-frame tests use lua_job. Full format: resource mcpagent://tests-format. Example: {"realm": "server", "path": "tests/.lua"}.
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": {
"path": "<path>"
},
"name": "tests_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File or pattern, relative to lua/mcpagent_tmp/ or absolute. | |
| realm | No | Default server. | |
| budget | No | Time limit per step (load, beforeAll, each case...) in seconds (default 10). | |
| instance | No | Optional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| next | No | ||
| note | No | ||
| files | Yes | ||
| totals | Yes | ||
| warning | No | ||
| next_call | No | ||
| answered_by | No | ||
| truncated_note | No | ||
| version_warning | No |