Skip to main content
Glama

Cancel a job

cancel_job
DestructiveIdempotent

Cancel a job: stops its machine and billing, and the status becomes cancelled. Cancelling a cancelled job changes nothing; a job that already ended another way cannot be cancelled. Returns the job. cost_usd covers the machine's whole time, not only the command's: from when its machine came up until it stopped, so setup before the command (pulling the image, waiting for the GPU driver, unpacking code) is included, at each machine's hourly rate (cost_per_hour is the current one's) and with every attempt added up. It is in USD to six decimal places, so a short run is not shown as $0, and while the job runs it is the cost so far. The charge on the billing page can differ slightly: machines billed by the minute are charged whole minutes, including about 30 seconds of teardown, and time some hosts report offline is not charged.

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

Input Schema

NameRequiredDescriptionDefault
idYesJob ID
workspaceNoWorkspace ID (optional: defaults to the authenticated workspace)
environmentNoEnvironment name (optional: defaults to the environment this session acts in)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / env
      Removed value: -{
      -  "description": "Environment name (optional — defaults to main)",
      -  "type": "string"
      -}
    • addedInput schema / properties / environment
      Added value: +{
      +  "description": "Environment name (optional: defaults to the environment this session acts in)",
      +  "type": "string"
      +}
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace ID (optional — defaults to authenticated workspace)"New value: +"Workspace ID (optional: defaults to the authenticated workspace)"
  2. First observed

TDQS

A4/5.0
Behavior5/5

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

Consistent with annotations (destructiveHint=true, idempotentHint=true) and adds substance beyond them: idempotency semantics, the guard on already-finished jobs, the side effects (machine stopped, billing stopped), and that it returns the job. It also explains cost_usd semantics, which is genuinely beyond what the annotations provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first two sentences are tight and front-loaded with the action and its edge cases. The remaining ~80% of the text is a tangent about how cost_usd is computed, billed, and rounded, which is not specific to cancelling and inflates a short action tool considerably.

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?

With no output schema, the description does need to say what comes back, and it does ('Returns the job') plus much of the return field semantics. Effects, idempotency, and failure conditions are all covered. The cost discussion is complete but of marginal relevance to the cancel decision.

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 description coverage is 100%, so the schema already documents id, workspace, and environment, including their defaults. The description adds no parameter-level meaning at all. Baseline 3 applies.

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?

Opens with a specific verb+resource plus the concrete effect: 'Cancel a job: stops its machine and billing, and the status becomes cancelled.' That is unambiguous. It never differentiates itself from siblings like delete_job or cancel_job_group, which is the only thing keeping it out of 5 territory.

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?

Gives real when-it-does-nothing and when-it-fails conditions: 'Cancelling a cancelled job changes nothing; a job that already ended another way cannot be cancelled.' That is clear contextual guidance about preconditions. It still names no alternative (delete_job, cancel_job_group) for an agent choosing among siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.