Skip to main content
Glama

cancel_agent_turn

Destructive

Stop an active agent turn that is mid-execution to prevent costly loops or incorrect responses. Use when a consumer requests halt; cancellation propagates to sub-agents.

Instructions

Cancela um turn de agente EM ANDAMENTO (mid-LLM, mid-tool, mid-stream). Útil quando agente entrou em loop caro, está respondendo errado, ou consumer pediu para parar. Diferente de set_session_control(suspended) que só bloqueia próximo turn — aqui interrompe o que já executa. Em multi-agent (Sprint 63), cancelar parent propaga em cascata via root_execution_id pra sub-agentes ativos.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoMotivo opcional do cancel (audit/telemetria)
session_idYessession_id text (ou UUID id) da sessão alvo
Install Server

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already mark the tool as destructive and non-idempotent, so the description wisely adds context: it interrupts mid-execution and cascades to active sub-agents via root_execution_id in multi-agent scenarios. It does not detail consequences like partial output handling, but the key behavioral traits are disclosed and consistent with the annotations.

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?

Three dense sentences each carry meaningful content: the core action, the applicable scenarios, the distinction from a sibling tool, and the multi-agent cascading behavior. No filler or repetition; the most important information is front-loaded.

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?

The description is largely complete for a destructive cancellation tool: it names the target, the problem cases, the alternative, and the multi-agent propagation behavior. It could be slightly stronger on irreversibility or what happens to already-produced partial output, but overall an agent has enough to decide when and how to invoke it.

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 session_id and reason. The description adds no additional parameter-level meaning beyond what the schema provides, so the baseline score of 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 states a precise verb and resource: it cancels an agent turn that is in progress (mid-LLM, mid-tool, mid-stream). It clearly distinguishes itself from the sibling tool set_session_control(suspended), making the tool's scope unmistakable.

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?

It explicitly states when to use this tool: when the agent is in an expensive loop, responding incorrectly, or the consumer asks to stop. It also contrasts with set_session_control(suspended), telling the agent exactly when this tool is the right choice instead of an alternative.

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

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/zihin-ai/zihin-mcp'

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