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
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID to cancel |
Implementation Reference
- src/kiro_cli_mcp/server.py:372-386 (handler)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", }
- src/kiro_cli_mcp/tools.py:177-190 (schema)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"] } },
- src/kiro_cli_mcp/server.py:121-122 (registration)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)