Skip to main content
Glama

Cancel a Lua job

lua_job_cancel
Destructive

Stops a running async Lua job at its next frame and returns its job_id and cancellation status, so callers can confirm whether the job was cancelled.

Instructions

Asks a running job (started by lua_job, e.g. with async: true) to stop: it ends at its next frame, before resuming. Result: {job_id, cancelled (false if the id is unknown), note}. Its final state (cancelled) stays readable once with lua_job_status. Example: {"id": "server-g3-1"}.

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": {
      "id": "<id>"
    },
    "name": "lua_job_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesJob id (e.g. 'server-g3-1').
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
nextNo
noteNo
job_idYes
warningNo
cancelledYes
next_callNo
answered_byNo
truncated_noteNo
version_warningNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.7

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the destructiveHint annotation by disclosing that cancellation is cooperative and takes effect at the next frame before resuming, so the agent knows it is not an immediate kill. It also states that an unknown id yields cancelled=false rather than an error, and that the final state is readable only once via lua_job_status, which is non-obvious and materially affects how an agent sequences calls.

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 its effect, then the return shape, then the cross-reference to lua_job_status, then an example. Dense and largely waste-free, though the return-shape sentence partially duplicates the available output schema.

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?

Covers what an agent needs for a cooperative-cancel mutation: scope, effect timing, unknown-id behavior, and where the resulting state can be observed. The only omission is any mention of cross-instance relaying, which the schema already handles, and the return-value sentence is redundant given the output schema.

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 coverage is 100%, so both id and instance are already documented, and the description's example ({"id": "server-g3-1"}) largely repeats the schema's own id example. It adds the meaningful detail that an unrecognized id returns cancelled=false, but says nothing about the instance/relay parameter beyond what the schema states, so the baseline 3 applies.

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?

Specific verb and resource: it asks a running job to stop, and it explicitly ties the target to jobs started by lua_job (e.g. async: true). That framing distinguishes it cleanly from lua_job (start) and lua_job_status (observe state) without either schema being opened.

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 tells the agent the applicable context (a job that is currently running, created via lua_job with async) and routes status checking to lua_job_status. There is no explicit when-not guidance or statement about calling it on an already-finished job, but the applicable scenario is unambiguous.

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