get_next_tasks
Retrieve pending tasks from TaskWarrior to view and manage upcoming work items based on project or tags.
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 the 'get_next_tasks' tool. Parses input arguments using listPendingTasksRequest schema, constructs TaskWarrior command with optional project and tags filters, executes 'task limit: ... next' via execSync, and returns the 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)Zod input schema for 'get_next_tasks' tool: optional project (regex ^[a-z.]+$ ) and tags (array of single lowercase letters).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)Registration of the 'get_next_tasks' tool in the ListToolsRequestHandler, specifying name, description, and input schema.{ name: "get_next_tasks", description: "Get a list of all pending tasks", inputSchema: zodToJsonSchema(listPendingTasksRequest) as ToolInput, },