Skip to main content
Glama

cancel_interaction

Terminate a pending interactive agent session by specifying the run ID, enabling users to manage ongoing interactions on the ACP-MCP-Server efficiently.

Instructions

Cancel a pending interactive agent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'cancel_interaction' decorated with @mcp.tool(). Calls the InteractiveManager's cancel_interaction method and returns success message.
    @mcp.tool()
    async def cancel_interaction(run_id: str) -> str:
        """Cancel a pending interactive agent"""
        
        try:
            success = await manager.cancel_interaction(run_id)
            
            if success:
                return f"Successfully cancelled interaction: {run_id}"
            else:
                return f"No pending interaction found with ID: {run_id}"
                
        except Exception as e:
            return f"Error: {e}"
  • Core implementation in InteractiveManager class: removes the run_id from pending_interactions if present and returns True/False.
    async def cancel_interaction(self, run_id: str) -> bool:
        """Cancel a pending interaction"""
        
        if run_id in self.pending_interactions:
            del self.pending_interactions[run_id]
            return True
        return False
  • Registers the interactive tools including 'cancel_interaction' by calling register_interactive_tools on the MCP instance.
    register_interactive_tools(self.mcp, self.interactive_manager)
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states the action is 'cancel' but doesn't disclose whether this is destructive, reversible, requires specific permissions, or what happens to the agent's state. The term 'pending' suggests it might only work on certain agent statuses, but this isn't elaborated.

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?

The description is extremely concise with a single, clear sentence. It's front-loaded with the core action and target, with zero wasted words or redundant phrasing.

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

Completeness3/5

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

For a single-parameter mutation tool with no annotations, the description is minimally adequate but has significant gaps. The existence of an output schema helps, but the description doesn't address behavioral implications, parameter meaning, or usage context. It meets a bare minimum but lacks completeness for safe, informed use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but provides no parameter information. It doesn't explain what 'run_id' represents, how to obtain it, or its format. The single required parameter remains undocumented beyond the schema's basic structure.

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?

The description clearly states the action ('Cancel') and target ('a pending interactive agent'), providing a specific verb+resource combination. However, it doesn't differentiate from potential sibling tools like 'list_active_runs' or 'get_async_run_result' that might relate to agent management.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a run_id from 'list_pending_interactions'), nor does it clarify what constitutes a 'pending interactive agent' versus other agent states.

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

Related 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/GongRzhe/ACP-MCP-Server'

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