update_task
Modify existing task details like description, priority, due dates, and tags while automatically assigning it to the requesting agent for exclusive editing.
Instructions
Update fields on an existing task. Auto-claims the task for the calling agent.
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. | |
| description | No | New description | |
| project | No | New project | |
| priority | No | Priority: H, M, or L | |
| tags | Yes | Tags to add | |
| remove_tags | Yes | Tags to remove | |
| due | No | Date in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow) | |
| scheduled | No | Date in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow) | |
| wait | No | Date in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow) | |
| until | No | Date in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow) | |
| depends | Yes | UUIDs this task depends on |
Implementation Reference
- src/taskwarrior.ts:126-134 (handler)The `modifyTask` function executes the actual task modification by building arguments and running the 'task' CLI command.
export async function modifyTask(id: string, fields: TaskFields, agentId: string): Promise<void> { const uuid = await ensureClaim(id, agentId); try { const args = buildModifyArgs(fields); await runCommand('task', [uuid, 'modify', ...args]); } catch (err) { throw new Error(`Failed to modify task ${id}: ${(err as Error).message}`); } } - src/index.ts:138-170 (registration)Registration of the 'update_task' tool including input schema definition and call to modifyTask handler.
server.tool( 'update_task', 'Update fields on an existing task. Auto-claims the task for the calling agent.', { id: idParam, agent_id: agentIdParam, description: z.string().optional().describe('New description'), project: z.string().optional().describe('New project'), priority: priorityParam, tags: tagsParam, remove_tags: z.preprocess(coerceStringArray, z.array(z.string()).optional()).describe('Tags to remove'), due: dateParam, scheduled: dateParam, wait: dateParam, until: dateParam, depends: z.preprocess(coerceStringArray, z.array(z.string()).optional()).describe('UUIDs this task depends on'), }, async ({ id, agent_id, remove_tags, ...fields }) => { try { await modifyTask(id, { description: fields.description, project: fields.project, priority: fields.priority as Priority | undefined, tags: fields.tags, removeTags: remove_tags, due: fields.due, scheduled: fields.scheduled, wait: fields.wait, until: fields.until, depends: fields.depends, }, agent_id); return { content: [{ type: 'text', text: `Task ${id} updated.` }] }; } catch (err) {