Skip to main content
Glama

kiro_task_cancel

Cancel a running asynchronous task by specifying its task ID to stop ongoing operations and manage workflow execution.

Instructions

Cancel a running async task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesThe task ID to cancel

Implementation Reference

  • The _handle_task_cancel function that executes the kiro_task_cancel tool logic: extracts task_id from arguments, calls task_manager.cancel_task, and returns success status with message.
    async def _handle_task_cancel(
        task_manager: StreamingTaskManager,
        arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """Handle kiro_task_cancel tool call - cancel a running task."""
        task_id = arguments.get("task_id", "")
        
        cancelled = await task_manager.cancel_task(task_id)
        
        return {
            "success": cancelled,
            "task_id": task_id,
            "message": "Task cancelled" if cancelled else "Task not found or already completed",
        }
  • JSON schema definition for the kiro_task_cancel tool input, requiring a task_id string.
    {
        "name": "kiro_task_cancel",
        "description": "Cancel a running async task",
        "inputSchema": {
            "type": "object",
            "properties": {
                "task_id": {
                    "type": "string",
                    "description": "The task ID to cancel"
                }
            },
            "required": ["task_id"]
        }
    },
  • Registration in the MCP call_tool handler dispatch that matches the tool name and invokes the handler function.
    elif name == "kiro_task_cancel":
        result = await _handle_task_cancel(task_manager, arguments)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('Cancel') but doesn't describe what cancellation entails (e.g., whether it's immediate, reversible, affects other tasks, or requires specific permissions). This is a significant gap for a mutation tool with zero annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with zero waste.

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

Completeness2/5

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

Given the complexity of canceling a running task (a mutation operation) with no annotations and no output schema, the description is incomplete. It lacks details on behavior, side effects, error conditions, or what happens post-cancellation, which are critical for safe and effective use.

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?

The schema description coverage is 100%, with the single parameter 'task_id' clearly documented in the schema. The description doesn't add any meaning beyond what the schema provides (e.g., format examples or sources for task IDs), so it meets the baseline of 3 when the schema does the heavy lifting.

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 the target ('a running async task'), which is specific and unambiguous. However, it doesn't explicitly differentiate this tool from its sibling 'kiro_task_list' or 'kiro_task_status', which are related to task management but serve different purposes.

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., that the task must be running), exclusions (e.g., tasks that cannot be canceled), or refer to sibling tools like 'kiro_task_status' for checking task state before cancellation.

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/vanphappi/kiro-cli-mcp'

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