get_current_task
Retrieve the currently active task from Super Productivity. Use this tool to identify the task you are working on at the moment, supporting time management and daily planning.
Instructions
Returns the currently active task, if any.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/tasks.ts:144-152 (handler)Tool handler for 'get_current_task' — calls SpClient.getCurrentTask() and returns the result as JSON.
server.tool( "get_current_task", "Returns the currently active task, if any.", {}, async () => { const task = await SpClient.getCurrentTask(); return ok(task); } ); - src/tools/tasks.ts:1-6 (registration)Import statements and the registerTaskTools function that registers 'get_current_task' via server.tool() in the MCP server.
// src/tools/tasks.ts import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { SpClient } from "../sp-client.js"; import { parseIsoDateToTimestamp, resolveProjectId, resolveTagId, resolveTagIds } from "../tool-helpers.js"; - src/sp-client.ts:271-273 (helper)SpClient.getCurrentTask() — makes a GET request to /task-control/current and returns a Task or null, parsed with TaskSchema.nullable().
getCurrentTask(): Promise<Task | null> { return request("/task-control/current", TaskSchema.nullable()); }, - src/sp-client.ts:27-38 (schema)TaskSchema — Zod schema used to validate/parse the task data returned by getCurrentTask().
const TaskSchema = z.object({ id: z.string(), title: z.string(), notes: nullableString, projectId: nullableString, tagIds: z.array(z.string()).nullish(), isDone: z.boolean().default(false), timeEstimate: nullableNumber, timeSpent: nullableNumber, dueDate: nullableNumber, created: nullableNumber, }).passthrough(); - src/index.ts:16-16 (registration)Server entry point — calls registerTaskTools(server) which registers the 'get_current_task' tool.
registerTaskTools(server);