stop_timer
Stop a running timer and finalize the time entry with calculated hours for Harvest time tracking.
Instructions
Stop a running timer and finalize the time entry with calculated hours.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the running time entry to stop |
Implementation Reference
- src/tools/time-entries.ts:135-151 (handler)The handler class that implements the logic for the 'stop_timer' tool by invoking the Harvest API client.
class StopTimerHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const validatedArgs = validateInput(StopTimerSchema, args, 'stop timer'); logger.info('Stopping timer via Harvest API', { timeEntryId: validatedArgs.id }); const timeEntry = await this.config.harvestClient.stopTimer(validatedArgs); return { content: [{ type: 'text', text: JSON.stringify(timeEntry, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'stop_timer'); } } } - src/tools/time-entries.ts:319-332 (registration)Registration of the 'stop_timer' tool within the time entry tools module.
tool: { name: 'stop_timer', description: 'Stop a running timer and finalize the time entry with calculated hours.', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'The ID of the running time entry to stop' }, }, required: ['id'], additionalProperties: false, }, }, handler: new StopTimerHandler(config), },