# job_cancel

> Cancel job. Cancel a queued or running job.

Source: https://stuarty.com/docs/mcp/tools/job_cancel/

Cancel a queued or running job. A finished job returns unchanged; a cancelled export leaves no file.

## Behaviour

These are the annotations of the tool definition, the hints a client uses to decide whether to ask before a call. `job_cancel` is listed by `tools/list`.

| Property | Value |
| --- | --- |
| Read only | no |
| Destructive | no |
| Idempotent | yes |
| Reaches outside the workspace | no |

## Input

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `job_id` | `string` | yes | pattern `^job_[0-9a-hjkmnp-tv-z]{10}$` |

## Output

A result has a text block, written for the model, and structured content with these members.

| Member | Type | Always present | Notes |
| --- | --- | --- | --- |
| `job_id` | `string` | yes |  |
| `state` | `queued`, `running`, `succeeded`, `failed`, `cancelled` | yes |  |

## Errors

- [`E_VALIDATION`](/docs/reference/error-codes#e_validation)
- [`E_NOT_FOUND`](/docs/reference/error-codes#e_not_found)

A call over HTTP without credentials fails with `E_UNAUTHORIZED`, and too many calls with `E_RATE_LIMITED`. Both are in the [error codes](/docs/reference/error-codes).

## Safety

- A job already in a final state is returned unchanged. A cancelled export leaves no file.

## Next steps

- [Connect a client](/docs/mcp/connect)
- [The MCP tools](/docs/mcp/tools)

**Ask the agent**

> Cancel that export.

**The call**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "job_cancel",
    "arguments": {
      "job_id": "job_9d4f6k2m8q"
    }
  }
}
```

**The result**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "…"
      }
    ],
    "structuredContent": {
      "job_id": "job_9d4f6k2m8q",
      "state": "cancelled"
    }
  }
}
```

The values are illustrative. The text block holds the same result written for the model; its wording is left out here.
