get-upcoming
Retrieve upcoming tasks from Things 3 with customizable detail levels and quantity limits for task management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | No | Response detail level. Defaults to compact. | |
| limit | No | Maximum number of todos to return |
Implementation Reference
- src/index.ts:1284-1303 (handler)The "get-upcoming" tool handler, which fetches upcoming tasks from the database and returns them formatted.
server.tool( "get-upcoming", { detail: z.enum(["compact", "full"]).optional().describe("Response detail level. Defaults to compact."), limit: z.number().int().positive().optional().describe("Maximum number of todos to return"), }, async ({ detail, limit }) => { const requestedDetail = detail ?? "compact"; const todos = await withDatabase((db) => applyLimit(getUpcomingTodos(getAllTasks(db)), limit).map((task) => toTaskView(task, requestedDetail) ) ); return buildTextResponse(`Found ${todos.length} upcoming todos`, { todos, detail: requestedDetail, limit: limit ?? null, }); } ); - src/index.ts:662-670 (helper)Helper function that calculates the upcoming todos by filtering based on start date and project context.
function getUpcomingTodos(tasks: TaskRecord[]) { const today = toDateOnly(new Date()); return filterOutSomedayProjectTasks(filterNonTrashedIncompleteTodos(tasks)).filter( (task) => task.start === "Someday" && task.startDate !== null && task.startDate > today ); }