Skip to main content
Glama

Cancel a DSH task

dsh_cancel_task
Idempotent

Terminates a running DSH task and its process tree by task id. Use it to stop a runaway task or honor a user's stop request; repeated calls are safe since finished tasks return cancelled=false.

Instructions

Terminate a running DSH task and its process tree. Cancellation is idempotent: if the task already finished, returns cancelled=false. Only use when the user asks to stop, or when a task is clearly runaway.

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": "dsh_cancel_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonNoShort reason shown in local bridge logs.
task_idYesTask id to cancel.

Output Schema

NameRequiredDescriptionDefault
okYes
statusYes
messageYes
task_idYes
cancelledYes
already_terminalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations, the description discloses that the whole process tree is terminated and that cancellation is idempotent with a cancelled=false return for already-finished tasks. That is real behavioral content the agent could not infer from idempotentHint/destructiveHint alone. It does not say whether termination is graceful or forced, or how long it takes to take effect.

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?

Two sentences, zero filler, with the core action and its scope front-loaded and the usage restriction placed last where it reads as a guardrail. Nothing could be cut without losing information.

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?

An output schema exists, so return values need not be explained, and the description still flags the cancelled=false case. For a two-parameter cancel tool this is nearly complete; only termination semantics (graceful vs. forced, timing) are left unstated.

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?

Schema coverage is 100% and both parameters (task_id, reason) are already documented in the schema, so the baseline is 3. The description adds no further meaning about task_id format or what reason is used for beyond the schema's own "shown in local bridge logs".

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?

"Terminate a running DSH task and its process tree" gives a specific verb (terminate), resource (DSH task), and scope (its process tree). Against siblings like dsh_start_task, dsh_get_status, and dsh_list_tasks, the operation is unmistakably distinct.

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 states a clear when-to-use condition: "Only use when the user asks to stop, or when a task is clearly runaway." That covers both user-initiated and proactive cases, though it gives no explicit when-not guidance or named alternative for softer interaction with a task.

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