Skip to main content
Glama

Delimit Agent Cancel

delimit_agent_cancel

Cancel a delegated task and terminate its live worker process, recording the reason and releasing its lock. Use when work is stuck, misguided, or no longer needed.

Instructions

Cancel a task and terminate its worker process if still alive.

When to use: to withdraw delegated work — a stuck or misguided worker, a duplicate dispatch, or a task the plan no longer needs. Records "cancelled" with the reason and signals the live worker (pid recorded at launch, cmdline-validated against the session id, with a pkill-by-session fallback). Cancellation and "uncertain outcome" stay distinct: cancelled tasks can never be closed via delimit_agent_complete — re-dispatch instead. When NOT to use: to close finished work (use delimit_agent_complete), to read state (use delimit_agent_status), or to transfer ownership (use delimit_agent_handoff).

Sibling contrast: delimit_agent_complete accepts and closes; this withdraws. delimit_agent_poll observes without changing the worker; this stops it.

Side effects: writes the cancellation via ai.agent_dispatch.cancel_task (status, reason, timestamp, and whether a live process was signalled) plus an audit entry, and releases any checkout lock the task holds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonYesWhy the task is cancelled. Required.
task_idYesTask id to cancel (AGT-xxx). Required.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.19.1

TDQS

A4.6/5.0
Behavior5/5

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

The description discloses significant behavioral detail beyond the annotations: it records 'cancelled' with reason, signals the live worker via pid/cmdline validation with pkill-by-session fallback, writes via ai.agent_dispatch.cancel_task with status/reason/timestamp/signal flag, adds an audit entry, and releases checkout locks. It also clarifies the semantic distinction between cancellation and 'uncertain outcome' and that cancelled tasks cannot be closed via delimit_agent_complete. This is rich, non-obvious behavioral context that annotations (readOnlyHint=false, destructiveHint=false) do not capture.

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

Conciseness4/5

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

The description is well-structured with clear sections (When to use, When NOT to use, Sibling contrast, Side effects) and front-loads the core action. It is somewhat long but every section earns its place by providing distinct value: usage guidance, sibling differentiation, and side-effect disclosure. The length is justified by the tool's complexity and the need to distinguish it from several closely related siblings.

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

Completeness5/5

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

Given the tool's complexity (process termination, state transitions, lock release, audit logging) and the presence of an output schema, the description is remarkably complete. It covers the action, the conditions for use, the exclusions, the side effects, and the semantic distinction from related states. An agent has everything needed to decide when to call this tool and what to expect.

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 description coverage is 100%, so the schema already documents both parameters (task_id and reason) with descriptions. The tool description adds context about the reason being recorded and the task id format (AGT-xxx) is already in the schema. The description doesn't add much beyond the schema, but the schema fully covers the parameters, so baseline 3 is appropriate.

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 opens with a specific verb and resource: 'Cancel a task and terminate its worker process if still alive.' It clearly distinguishes this from siblings by contrasting with delimit_agent_complete, delimit_agent_poll, and delimit_agent_handoff. The purpose is unambiguous and the tool's role in the lifecycle is explicit.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use scenarios (stuck/misguided worker, duplicate dispatch, plan no longer needs task), explicit when-NOT-to-use scenarios (closing finished work, reading state, transferring ownership), and names the exact alternative tools for each. This is exemplary usage guidance.

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

Deploy Server

Other Tools