get_next_tasks
Retrieve pending tasks organized by project or tags using the TaskWarrior MCP Server to streamline task management and prioritize next actions effectively.
Instructions
Get a list of all pending tasks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | ||
| tags | No |
Implementation Reference
- index.ts:121-139 (handler)Handler for get_next_tasks tool: parses input with listPendingTasksRequest schema, constructs taskwarrior command with optional project/tags filters, executes 'task ... next' via execSync, returns output as text content.case "get_next_tasks": { const parsed = listPendingTasksRequest.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments for get_next_tasks: ${parsed.error}`); } let task_args = []; if (parsed.data.tags) { for(let tag of parsed.data.tags) { task_args.push(`+${tag}`); } } if (parsed.data.project) { task_args.push(`project:${parsed.data.project}`); } const content = execSync(`task limit: ${task_args.join(" ")} next`, { maxBuffer: 1024 * 1024 * 10 }).toString().trim(); return { content: [{ type: "text", text: content }], }; }
- index.ts:36-39 (schema)Input schema for get_next_tasks: optional project (regex validated) and tags array (each tag regex a-z). Used for validation and converted to JSON schema for tool registration.const listPendingTasksRequest = z.object({ project: z.string().regex(/^[a-z.]+$/).optional(), tags: z.array(z.string().regex(/^a-z$/)).optional(), });
- index.ts:96-100 (registration)Tool registration in ListTools response: defines name, description, and inputSchema from listPendingTasksRequest.{ name: "get_next_tasks", description: "Get a list of all pending tasks", inputSchema: zodToJsonSchema(listPendingTasksRequest) as ToolInput, },