Skip to main content
Glama

cancel_job

Stops a running turn, or ends a turn that is waiting for your review by discarding its staged changes. Already-applied changes are preserved in the document; anything still pending is discarded. Use to abort work that is no longer wanted (e.g. the user changed their mind, or you want to retry with different parameters or model_tier). The response tells you whether the work was stopped here and now (stop_state: "stopped_here") or the stop was ACCEPTED and is being carried out by the instance running the turn (stop_state: "accepted") — in the accepted case poll get_job until metadata.stopped_unwound is true or the job reaches a terminal status. A turn that already finished cannot be stopped and returns 409 naming its status.

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": {
      "job_id": "<job_id>"
    },
    "name": "cancel_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / authorization
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "title": "Authorization"
      -}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it discloses the partial-mutation semantics (applied changes preserved, pending work discarded), the asynchronous two-outcome model via stop_state values, the required polling loop on metadata.stopped_unwound, and the 409 failure mode for terminal jobs. This is far beyond what a bare 'cancel' would convey.

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, then behavior, then usage, then return semantics — a sensible order. Slightly long, and the parenthetical example list of retry motivations is the least essential clause, but no sentence is wasted.

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?

No output schema and no annotations, so the description must cover return values and it does (stop_state: stopped_here vs accepted, metadata.stopped_unwound, 409 with status name). For a single-parameter mutation tool this is complete enough to invoke and handle correctly.

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?

Only one parameter (job_id) with 0% schema description coverage, and the description never defines the identifier's origin or format — it only implies it via the get_job reference. Adequate by inference from sibling list_jobs/get_session_jobs, but it adds no explicit meaning over 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?

States a specific verb and resource pair — stops a running turn or ends a review-pending turn — and immediately distinguishes the two modes plus what happens to staged vs applied changes. An agent can tell this apart from approve_change or get_job without opening any schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use context ('abort work that is no longer wanted', changed mind, retry with different parameters or model_tier), tells the agent to fall back to get_job for polling in the accepted case, and names the boundary condition (a finished turn returns 409). Both the trigger and the follow-up path are stated.

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.