Skip to main content
Glama
standardbeagle

Harvest MCP Server

harvest_stop_timer

Stop a active time entry timer in Harvest by providing the time entry ID, allowing users to end tracking sessions and finalize work duration records.

Instructions

Stop a running time entry timer. Use about {"tool": "harvest_stop_timer"} for detailed workflow and examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTime entry ID

Implementation Reference

  • MCP server handler for 'harvest_stop_timer' tool: extracts ID from arguments, calls HarvestClient.stopTimer(id), and returns the result as JSON text content.
    case 'harvest_stop_timer': const stoppedTimer = await harvestClient.stopTimer(typedArgs.id as string); return { content: [ { type: 'text', text: JSON.stringify(stoppedTimer, null, 2), }, ], };
  • Tool schema definition including name, description, and inputSchema requiring 'id' parameter (string). Part of the exported tools array used for tool listing.
    { name: 'harvest_stop_timer', description: 'Stop a running time entry timer. Use about {"tool": "harvest_stop_timer"} for detailed workflow and examples.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Time entry ID' } }, required: ['id'] } },
  • Core helper method in HarvestClient that performs PATCH request to Harvest API endpoint /time_entries/{id}/stop to stop the running timer.
    async stopTimer(id: string) { return this.makeRequest(`/time_entries/${id}/stop`, { method: 'PATCH', }); }
  • Generic HTTP request helper used by stopTimer: constructs authenticated fetch request to Harvest API with error handling.
    private async makeRequest(endpoint: string, options: RequestInit = {}) { const url = `${this.baseUrl}${endpoint}`; const response = await fetch(url, { ...options, headers: { 'Authorization': `Bearer ${this.accessToken}`, 'Harvest-Account-ID': this.accountId, 'User-Agent': this.userAgent, 'Content-Type': 'application/json', ...options.headers, }, }); if (!response.ok) { let errorMessage = `Harvest API error: ${response.status} ${response.statusText}`; try { const errorBody = await response.json() as any; if (errorBody.message) { errorMessage += ` - ${errorBody.message}`; } } catch { // If we can't parse the error response, use the basic error message } throw new Error(errorMessage); } return response.json(); }

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/standardbeagle/harvest-mcp'

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