getTasks
Retrieve organized tasks from your knowledge base, grouped by file with details like status, priority, and due dates for today or backlog sections.
Instructions
Get all tasks grouped by file (today + backlog). Returns tasks with id, text, status, tags, priority, dueDate.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| section | No | Which task section to retrieve | all |
Implementation Reference
- src/core/brain.ts:85-97 (handler)The actual implementation of the getTasks logic that reads and parses tasks from a specific brain section.
async getTasks(section: "today" | "backlog"): Promise<Task[]> { const log = getLogger(); const brainSection: BrainSection = `tasks/${section}`; try { const file = await this.sync.readSection(brainSection); const tasks = parseTasks(file.content, brainSection); log.info("getTasks", { section, count: tasks.length }); return tasks; } catch (err) { if (isNotFound(err)) return []; throw err; } } - src/tools/tasks.ts:7-24 (registration)Registration of the "getTasks" MCP tool, including its schema definition and handler invocation.
server.registerTool( "getTasks", { description: "Get all tasks grouped by file (today + backlog). Returns tasks with id, text, status, tags, priority, dueDate.", inputSchema: { section: z .enum(["today", "backlog", "all"]) .optional() .default("all") .describe("Which task section to retrieve"), }, }, toolHandler("getTasks", async ({ section }) => { if (section === "all") return brain.getAllTasks(); return brain.getTasks(section); }) );