start_pomodoro
Start a timed Pomodoro session for focused work, short breaks, or long breaks to enhance task management productivity.
Instructions
Start a new pomodoro session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | No | Task ID to work on (optional) | |
| duration | No | Custom duration in minutes (optional) | |
| type | Yes | Type of session |
Implementation Reference
- src/index.ts:372-416 (handler)Handler function that starts a new pomodoro session based on the provided type (work, short-break, long-break), optionally for a specific task, using default or custom duration. Creates and saves a new PomodoroSession.case "start_pomodoro": { const type = args.type as "work" | "short-break" | "long-break"; let duration: number; if (args.duration) { duration = args.duration as number; } else { switch (type) { case "work": duration = data.settings.workDuration; break; case "short-break": duration = data.settings.shortBreakDuration; break; case "long-break": duration = data.settings.longBreakDuration; break; } } const session: PomodoroSession = { id: Date.now().toString(), taskId: args.taskId as string, duration, type, startTime: new Date().toISOString(), completed: false, }; data.sessions.push(session); saveData(data); return { content: [ { type: "text", text: JSON.stringify( { success: true, session, message: `${type} session started for ${duration} minutes`, }, null, 2 ), }, ], }; }
- src/index.ts:164-186 (schema)Input schema definition for the start_pomodoro tool, specifying parameters like taskId (optional), duration (optional), and required type (work/short-break/long-break).{ name: "start_pomodoro", description: "Start a new pomodoro session", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "Task ID to work on (optional)", }, duration: { type: "number", description: "Custom duration in minutes (optional)", }, type: { type: "string", enum: ["work", "short-break", "long-break"], description: "Type of session", }, }, required: ["type"], }, },
- src/index.ts:245-247 (registration)Registration of all tools including start_pomodoro via the ListToolsRequestSchema handler, which returns the TOOLS array containing the tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));