Skip to main content
Glama

cancel_task

cancel_task
Destructive

Cancel running or queued tasks: terminates CLI agent process trees, clicks GUI stop buttons with bounded timeout, and removes queued items. Unconfirmed stops are explicitly reported.

Instructions

取消运行中任务:CLI agent 终止进程树;GUI agent(codex 等)尽力点击界面停止按钮并等待 GUI 空闲(有界超时),未确认停止时结果中明示。排队中任务直接移除;终态任务无动作。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNo
taskIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
modeNo
modelNo
roundNo
checksNo
resultNo
statusNo
taskIdNo
agentIdNo
logFileNo
messageNo
diffstatNo
errorTypeNo
finishedAtNo
abortSourceNo
projectPathNo
reportFilesNo
reportRoundNo
cancelReasonNo
changedFilesNo
keptInstanceNo
lastRunSignalNo
modelProviderNo
needsUserKindNo
agentEndReasonNo
permissionModeNo
zcodeSessionIdNo
pendingQuestionNo
progressSummaryNo
boundProjectPathNo
cancelRequestedAtNo
verificationSourceNo
latestVerificationVerdictNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "abortSource": {
      +      "type": "string"
      +    },
      +    "agentEndReason": {
      +      "type": "string"
      +    },
      +    "agentId": {
      +      "type": "string"
      +    },
      +    "boundProjectPath": {
      +      "type": "string"
      +    },
      +    "cancelReason": {
      +      "type": "string"
      +    },
      +    "cancelRequestedAt": {
      +      "type": "string"
      +    },
      +    "changedFiles": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "checks": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "durationMs": {
      +            "type": "number"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "passed": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "passed",
      +          "durationMs"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "diffstat": {
      +      "type": "string"
      +    },
      +    "errorType": {
      +      "type": "string"
      +    },
      +    "finishedAt": {
      +      "type": "string"
      +    },
      +    "keptInstance": {
      +      "type": "boolean"
      +    },
      +    "lastRunSignal": {
      +      "type": "string"
      +    },
      +    "latestVerificationVerdict": {
      +      "type": "string"
      +    },
      +    "logFile": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "mode": {
      +      "type": "string"
      +    },
      +    "model": {
      +      "type": "string"
      +    },
      +    "modelProvider": {
      +      "type": "string"
      +    },
      +    "needsUserKind": {
      +      "type": "string"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "pendingQuestion": {
      +      "type": "string"
      +    },
      +    "permissionMode": {
      +      "type": "string"
      +    },
      +    "progressSummary": {
      +      "type": "string"
      +    },
      +    "projectPath": {
      +      "type": "string"
      +    },
      +    "reportFiles": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "json": {
      +          "type": "string"
      +        },
      +        "md": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "reportRound": {
      +      "type": "number"
      +    },
      +    "result": {},
      +    "round": {
      +      "type": "number"
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "taskId": {
      +      "type": "string"
      +    },
      +    "verificationSource": {
      +      "type": "string"
      +    },
      +    "zcodeSessionId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv0.5.4

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description details exact mechanisms (CLI process-tree termination, GUI button-click with bounded timeout, explicit indication if stop is unconfirmed) and state-dependent outcomes. This adds significant value beyond the annotation.

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?

A single well-structured sentence front-loads the core action, then details state-dependent behavior. No wasted words; all sentences earn their place.

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?

Given the output schema exists (so return values are covered), the description adequately explains the tool's behavior for all task states. It could mention the reason parameter's purpose, but that's minor given the simple tool and existing output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description must compensate for parameters. It never mentions taskId (obviously the target) or reason (optional). The description focuses on behavior but provides no direct guidance on parameter usage or semantics.

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?

The description clearly states the tool cancels running tasks, and differentiates behavior for CLI vs GUI agents, plus queued and terminal states. It uses a specific verb ('取消'/cancel) and resource ('任务'/task), making it distinct from siblings like continue_task or run_task.

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?

It explains behavior across task states (running, queued, terminal), implying when to use it (for running/queued) and when it does nothing (terminal). It doesn't explicitly name alternatives, but the purpose is unambiguous and no misleading guidance is present.

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