Skip to main content
Glama

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
NameRequiredDescriptionDefault
taskIdNoTask ID to work on (optional)
durationNoCustom duration in minutes (optional)
typeYesType of session

Implementation Reference

  • 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
            ),
          },
        ],
      };
    }
  • 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,
    }));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PratyayRajak/todopomo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server