list_tasks
Get tasks from Super Productivity by applying filters like title, project, tag, include done, and source to narrow results.
Instructions
Returns tasks from Super Productivity with optional filters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Filter by title text (case-insensitive contains) | |
| projectId | No | Filter by project ID | |
| projectName | No | Filter by project name | |
| tagId | No | Filter by tag ID | |
| tagName | No | Filter by tag name | |
| includeDone | No | Include completed tasks | |
| source | No | Which task source to query |
Implementation Reference
- src/tools/tasks.ts:73-96 (handler)Handler: The 'list_tasks' tool definition. Accepts optional query, projectId/projectName, tagId/tagName, includeDone, and source filters. Resolves name-based IDs via resolveTaskFilterIds, then calls SpClient.getTasks and returns the result.
server.tool( "list_tasks", "Returns tasks from Super Productivity with optional filters.", { query: nonEmptyString.optional().describe("Filter by title text (case-insensitive contains)"), projectId: nonEmptyString.optional().describe("Filter by project ID"), projectName: nonEmptyString.optional().describe("Filter by project name"), tagId: nonEmptyString.optional().describe("Filter by tag ID"), tagName: nonEmptyString.optional().describe("Filter by tag name"), includeDone: z.boolean().optional().describe("Include completed tasks"), source: z.enum(["active", "archived", "all"]).optional().describe("Which task source to query"), }, async ({ query, projectId, projectName, tagId, tagName, includeDone, source }) => { const resolved = await resolveTaskFilterIds({ projectId, projectName, tagId, tagName }); const tasks = await SpClient.getTasks({ query, projectId: resolved.projectId, tagId: resolved.tagId, includeDone, source, }); return ok(tasks); } ); - src/sp-client.ts:181-187 (schema)Schema: TypeScript interface defining the ListTasksFilters object used to pass filter options to the API.
export interface ListTasksFilters { query?: string; projectId?: string; tagId?: string; includeDone?: boolean; source?: "active" | "archived" | "all"; } - src/index.ts:16-16 (registration)Registration: Entry point calls registerTaskTools(server) which registers list_tasks along with all other task tools.
registerTaskTools(server); - src/sp-client.ts:207-218 (helper)Helper: SpClient.getTasks makes the actual HTTP GET request to /tasks with query parameters, returning a parsed array of Task objects.
getTasks(filters?: ListTasksFilters): Promise<Task[]> { return request( withQuery("/tasks", { query: filters?.query, projectId: filters?.projectId, tagId: filters?.tagId, includeDone: filters?.includeDone, source: filters?.source, }), z.array(TaskSchema) ); },