delete_task
Remove a task from the task-mcp server by providing its ID and agent identifier. The tool automatically claims the task before deletion to ensure proper management.
Instructions
Delete a task. Auto-claims then releases after deletion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Task ID or UUID | |
| agent_id | Yes | Globally unique agent identifier (e.g. "claude-opus-<uuid>"). Each agent instance MUST use a distinct ID to prevent collisions between parallel agents. |
Implementation Reference
- src/taskwarrior.ts:146-154 (handler)The handler function that executes the deletion command for a taskwarrior task.
export async function deleteTask(id: string, agentId: string): Promise<void> { const uuid = await ensureClaim(id, agentId); try { await runCommand('task', ['rc.confirmation=no', uuid, 'delete']); } catch (err) { throw new Error(`Failed to delete task ${id}: ${(err as Error).message}`); } await releaseClaim(uuid); }