Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe ID of the running time entry to stop

Implementation Reference

  • 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');
        }
      }
    }
  • 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),
    },

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

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