restart_timer
Restart a stopped timer by creating a new time entry from an existing one, resuming time tracking in Harvest.
Instructions
Restart a previously stopped timer, creating a new running time entry based on an existing entry.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the time entry to restart the timer for |
Implementation Reference
- src/tools/time-entries.ts:153-169 (handler)The handler class `RestartTimerHandler` which implements `ToolHandler` and executes the restart_timer logic by calling the Harvest API client.
class RestartTimerHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(RestartTimerSchema, args, 'restart timer'); logger.info('Restarting timer via Harvest API', { timeEntryId: validatedArgs.id }); const timeEntry = await this.config.harvestClient.restartTimer(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(timeEntry, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'restart_timer'); } } } - src/tools/time-entries.ts:333-347 (registration)Tool registration for `restart_timer` within `registerTimeEntryTools`, mapping the tool definition to the `RestartTimerHandler`.
{ tool: { name: 'restart_timer', description: 'Restart a previously stopped timer, creating a new running time entry based on an existing entry.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The ID of the time entry to restart the timer for' }, }, required: ['id'], additionalProperties: false, }, }, handler: new RestartTimerHandler(config), },