Skip to main content
Glama

State of a Lua job

lua_job_status

Check a Lua job's progress, CPU use, and final result, wait for completion, or list all running and uncollected jobs across realms.

Instructions

With id: the state of a job started by lua_job (frames, elapsed_s, cpu_ms, last progress, reports_count); once it has finished, its full result exactly like lua_job's, and the job is then forgotten. wait_s waits up to that long for the end. A job id belongs to one Lua state: after a map change (new realm) an id of the old state answers realm_reset. Without id: every job of every realm, running or finished but not collected yet.

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": "lua_job_status"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoJob id returned by lua_job (e.g. 'server-g3-1').
fieldsNoKeep only these keys of each returned table.
wait_sNoWait up to this long for the job to finish (default 0).
instanceNoOptional. 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

NameRequiredDescriptionDefault
nNo
jobsNo
nextNo
noteNo
stateNo
cpu_msNo
framesNo
job_idNo
outputNo
valuesNo
reportsNo
resumesNo
warningNo
progressNo
elapsed_sNo
next_callNo
projectedNo
truncatedNo
generationNo
answered_byNo
fields_noteNo
reports_countNo
truncated_noteNo
version_warningNo
blocked_console_commandsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.5/5.0
Behavior5/5

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

With readOnlyHint=false supplied, the description earns credit by explaining the side effect behind it: once a job has finished, its result is returned and 'the job is then forgotten', i.e. polling is consuming. It also discloses the realm-coupling rule — after a map change an old id answers realm_reset — which is non-obvious behavior an agent could not infer from annotations or schema.

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 'With id:' / 'Without id:' framing front-loads the two modes and every clause carries information. The single parsing-heavy sentence with nested parentheticals is dense but not padded; a slightly more broken-up structure would read more easily.

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?

An output schema exists, so return shape need not be explained, and the description still covers the odd parts: job consumption, realm reset, and blocking waits. Only the instance-relay parameter and the fields filter are left entirely to structured fields, which is reasonable but a small gap for a four-parameter tool.

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 100%, so the baseline is 3, but the description adds real semantics: id is scoped to a single Lua state and is invalidated by a map change, and wait_s blocks up to the given interval for termination. Only the fields parameter is left to the schema.

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

Purpose5/5

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

The description names a specific resource (a job started by lua_job) and a specific operation (report its state), and explicitly splits the two modes: 'With id: the state of a job' versus 'Without id: every job of every realm'. The listed return fields (frames, elapsed_s, cpu_ms, last progress, reports_count) make it unambiguous which sibling this is, distinct from lua_job which starts jobs.

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?

It gives clear operative context: use an id to poll one job, omit it to enumerate all uncollected jobs, and use wait_s to block for completion. It does not name alternatives such as lua_job_cancel or explain when to cancel versus wait, so the routing to siblings is implied rather than stated.

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