Skip to main content
Glama

codex_cancel

Stop a running Codex background task and its child process tree by providing the task ID.

Instructions

Terminate a running Codex background task and its child process tree.

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": {
      "task_id": "<task_id>"
    },
    "name": "codex_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
task_idYesThe task_id to cancel.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It usefully reveals that the entire child process tree is killed, but says nothing about irreversibility, behavior when the task_id is already finished or unknown, whether an error is raised, or what confirmation is returned.

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

Conciseness5/5

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

One front-loaded sentence with zero filler; the destructive scope (process tree) is stated immediately and nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no output schema this is close to sufficient, but as an unannotated destructive operation it should state the effect on nonexistent or completed tasks and any confirmation returned.

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?

There is a single required parameter with 100% schema description coverage, which sets the baseline at 3. The description adds no meaning beyond the schema – no format hints for task_id or where an agent obtains it.

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?

States a specific verb ("Terminate") and precise resource ("a running Codex background task and its child process tree"), so an agent can distinguish it from codex_run, codex_status, codex_wait and codex_steer by action alone. It stops short of explicitly naming which sibling to use instead of cancelling.

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

Usage Guidelines3/5

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

Usage is only implied by the word "running" – cancel a task that is still executing. There is no explicit statement of when to cancel versus when to steer, wait, or check status, and no mention of preconditions such as owning the task.

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