create_task
Create new tasks with descriptions, priorities, tags, due dates, and dependencies to manage work in Taskwarrior through the task-mcp server.
Instructions
Create a new task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Task description (required) | |
| project | No | Project name | |
| priority | No | Priority: H, M, or L | |
| tags | Yes | Tags to add | |
| 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:117-124 (handler)The actual implementation of the createTask function that executes the 'task add' command.
export async function createTask(fields: TaskFields & { description: string }): Promise<void> { try { const args = buildModifyArgs(fields); await runCommand('task', ['add', ...args]); } catch (err) { throw new Error(`Failed to create task: ${(err as Error).message}`); } } - src/index.ts:104-136 (registration)Registration of the 'create_task' MCP tool, including input schema definition and the handler that calls the underlying implementation.
server.tool( 'create_task', 'Create a new task', { description: z.string().describe('Task description (required)'), project: z.string().optional().describe('Project name'), priority: priorityParam, tags: tagsParam, due: dateParam, scheduled: dateParam, wait: dateParam, until: dateParam, depends: z.preprocess(coerceStringArray, z.array(z.string()).optional()).describe('UUIDs this task depends on'), }, async (params) => { try { await createTask({ description: params.description, project: params.project, priority: params.priority as Priority | undefined, tags: params.tags, due: params.due, scheduled: params.scheduled, wait: params.wait, until: params.until, depends: params.depends, }); return { content: [{ type: 'text', text: `Task created: ${params.description}` }] }; } catch (err) { return { content: [{ type: 'text', text: (err as Error).message }], isError: true }; } }, );