stop_timer
Stop tracking time on a specific timeslip to record work duration in FreeAgent.
Instructions
Stop a running timer for a timeslip
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Timeslip ID |
Implementation Reference
- src/index.ts:247-253 (handler)MCP tool handler for 'stop_timer': extracts timeslip ID from arguments and calls client.stopTimer(id), returning the updated timeslip as JSON.case 'stop_timer': { const { id } = request.params.arguments as { id: string }; const timeslip = await this.client.stopTimer(id); return { content: [{ type: 'text', text: JSON.stringify(timeslip, null, 2) }] }; }
- src/index.ts:172-182 (registration)Registers the 'stop_timer' tool in the MCP server's list_tools response, including name, description, and input schema requiring a timeslip ID.{ name: 'stop_timer', description: 'Stop a running timer for a timeslip', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Timeslip ID' } }, required: ['id'] } }
- src/freeagent-client.ts:144-153 (helper)Core implementation of stopTimer: performs DELETE request to FreeAgent API endpoint /timeslips/{id}/timer to stop the running timer and returns the updated Timeslip.async stopTimer(id: string): Promise<Timeslip> { try { console.error('[API] Stopping timer for timeslip:', id); const response = await this.axiosInstance.delete<TimeslipResponse>(`/timeslips/${id}/timer`); return response.data.timeslip; } catch (error) { console.error('[API] Failed to stop timer:', error); throw error; } }