Skip to main content
Glama

cancel_agent

Interrupt an agent's current turn while keeping its session open for later messages.

Instructions

Interrupt the agent's current turn. The session stays open and can be messaged again.

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": {
      "id": "<id>"
    },
    "name": "cancel_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesjcode session id returned by spawn_agent

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does disclose the key non-obvious post-condition: the session survives and can be messaged again. It omits other important traits such as whether interruption is immediate, what happens to in-flight work or pending permission requests, and whether the call is idempotent or errors when no turn is active.

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 short sentences, zero filler, with the action stated first and the crucial post-condition immediately after. Nothing could be removed 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?

For a simple one-parameter control tool this covers purpose and the main state consequence. The remaining gap is the return value and the behavior on edge cases (no active turn, already-cancelled agent), which matters a bit more here because there is no output schema to document results.

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 the single id parameter is fully documented as the 'jcode session id returned by spawn_agent'. The description adds no parameter-level meaning, which is acceptable at baseline 3 but leaves nothing extra.

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 and target ('Interrupt the agent's current turn'), which is squarely distinct from spawning, messaging, or closing an agent. Differentiation from close_agent is conveyed indirectly through the post-condition that the 'session stays open' rather than by naming the alternative, so an agent must infer the contrast.

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: the reader must deduce you call this when you want to stop the current turn but keep the session alive for further messages. No explicit 'use this instead of close_agent when...' guidance and no mention of prerequisites or what to do if the agent is idle.

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