Skip to main content
Glama

Cancel a subagent invocation

cancel_agent
DestructiveIdempotent

Stop a running agent invocation using its invocation ID to retrieve the final cancelled or already-terminal result. Use this action when you need to end active subagent work.

Instructions

Stop one invocation and return its final cancelled or already-terminal result.

Use this only when the Manager intends to stop active provider work; use wait_agent to observe work without stopping it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invocation_idYesInvocation ID returned by start_agent.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes
resultYes
invocation_idYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.3.0
    • changedOutput schema / $defs / ProviderName / enum
      Previous value: -[
      -  "antigravity",
      -  "claude",
      -  "codebuddy",
      -  "grok"
      -]New value: +[
      +  "antigravity",
      +  "claude",
      +  "codebuddy",
      +  "codex",
      +  "grok"
      +]
  2. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered. The description adds value beyond those flags by disclosing the already-terminal case — calling cancel on a finished invocation returns its terminal result rather than failing — which explains the idempotency semantics. This aligns cleanly with the annotations, so no contradiction.

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 with zero waste. The core action and return behavior are front-loaded in sentence one, and the routing guidance in sentence two earns its place by preventing misuse of a destructive operation.

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?

For a single-parameter tool with full annotation coverage and an output schema present, the description covers the action, the return behavior, and the when/when-not decision. The only absent details (exact result shape) are already handled by the output schema, so nothing an agent needs to invoke this correctly is missing.

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%: the single required parameter invocation_id is documented as 'Invocation ID returned by start_agent,' which tells the agent where the value comes from. The description references 'one invocation' consistently but adds no syntax or format detail beyond the schema, so the baseline for high coverage applies.

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 — 'Stop one invocation' — and specifies the return behavior ('return its final cancelled or already-terminal result'). It also names the sibling it is not (wait_agent), so an agent can distinguish cancel from the observe-only tool without opening either schema.

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 second sentence is explicit: 'Use this only when the Manager intends to stop active provider work' gives the exact triggering condition. It then names the alternative ('use wait_agent to observe work without stopping it'), leaving no ambiguity about when to pick each sibling.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TimWongUp/agentnave'

If you have feedback or need assistance with the MCP directory API, please join our Discord server