Skip to main content
Glama

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
NameRequiredDescriptionDefault
descriptionYesTask description (required)
projectNoProject name
priorityNoPriority: H, M, or L
tagsYesTags to add
dueNoDate in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow)
scheduledNoDate in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow)
waitNoDate in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow)
untilNoDate in any format Taskwarrior accepts (e.g. 2024-12-25, tomorrow, eow)
dependsYesUUIDs this task depends on

Implementation Reference

  • 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 };
        }
      },
    );

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/maxronner/taskwarrior-mcp'

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