update_settings
Modify Pomodoro timer parameters including work duration, break intervals, and session cycles to customize productivity workflows.
Instructions
Update pomodoro timer settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workDuration | No | Work duration in minutes | |
| shortBreakDuration | No | Short break duration in minutes | |
| longBreakDuration | No | Long break duration in minutes | |
| pomodorosBeforeLongBreak | No | Number of pomodoros before long break |
Implementation Reference
- src/index.ts:500-527 (handler)The handler logic for the 'update_settings' tool. It conditionally updates the pomodoro settings (workDuration, shortBreakDuration, longBreakDuration, pomodorosBeforeLongBreak) based on the input arguments, saves the data to the JSON file, and returns the updated settings.case "update_settings": { if (args.workDuration) data.settings.workDuration = args.workDuration as number; if (args.shortBreakDuration) data.settings.shortBreakDuration = args.shortBreakDuration as number; if (args.longBreakDuration) data.settings.longBreakDuration = args.longBreakDuration as number; if (args.pomodorosBeforeLongBreak) data.settings.pomodorosBeforeLongBreak = args.pomodorosBeforeLongBreak as number; saveData(data); return { content: [ { type: "text", text: JSON.stringify( { success: true, settings: data.settings, message: "Settings updated successfully", }, null, 2 ), }, ], }; }
- src/index.ts:212-233 (schema)The tool registration and input schema definition for 'update_settings'. Specifies the name, description, and input schema with optional number properties for updating pomodoro timer settings.{ name: "update_settings", description: "Update pomodoro timer settings", inputSchema: { type: "object", properties: { workDuration: { type: "number", description: "Work duration in minutes" }, shortBreakDuration: { type: "number", description: "Short break duration in minutes", }, longBreakDuration: { type: "number", description: "Long break duration in minutes", }, pomodorosBeforeLongBreak: { type: "number", description: "Number of pomodoros before long break", }, }, }, },
- src/index.ts:245-247 (registration)Registers all tools, including 'update_settings', by setting the handler for ListToolsRequestSchema to return the TOOLS array.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- src/index.ts:71-73 (helper)Helper function called by the handler to persist the updated settings to the data file."},{function saveData(data: TodoPomoData): void { fs.writeFileSync(DATA_FILE, JSON.stringify(data, null, 2)); }