Skip to main content
Glama

codex_cancel

Terminate a running Codex task by task ID to stop background execution immediately.

Instructions

Terminate a currently running Codex task immediately.

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 running task_id to terminate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations at all, the description must carry the full behavioral burden for an irreversible mutation. It says the termination is 'immediate' but not whether the task's output, logs, or worktree survive, whether the task can later be resumed via codex_resume, or what happens if task_id refers to a non-running task. These are material gaps for a destructive operation.

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 short sentence with the action front-loaded and no filler. Every word contributes: verb, object, precondition, and timing.

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?

For a single-parameter, non-returning tool this is close to sufficient: the required input and the effect are both clear. It falls short only on consequences of termination (resumability, preserved artifacts), which matter given the absence of annotations and 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?

The single task_id parameter is fully documented in the schema at 100% coverage, so the schema does the heavy lifting. The description only reinforces that it must be a running task, adding marginal meaning beyond the schema text.

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 resource ('a currently running Codex task') with a timing qualifier ('immediately'). However, it does nothing to distinguish itself from siblings like codex_resume or codex_cleanup_worktree, so an agent cannot tell from the description alone which lifecycle operation applies.

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?

The phrase 'currently running' implicitly scopes use to active tasks, giving an agent a usable precondition. There is no explicit when-not guidance, no mention of what to do instead if the task is already finished, and no stated alternative tool for related lifecycle operations.

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