Skip to main content
Glama

start_timer

Start tracking time automatically for a new time entry in Harvest by specifying project, task, and date parameters.

Instructions

Start a timer for a new time entry. Creates a running time entry that tracks time automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesThe project ID to start the timer for
task_idYesThe task ID to start the timer for
spent_dateYesDate for the timer (YYYY-MM-DD format)
notesNoInitial notes for the timer
external_referenceNo

Implementation Reference

  • The handler implementation for the 'start_timer' tool, which uses Harvest API to initiate a timer.
    class StartTimerHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(StartTimerSchema, args, 'start timer');
          logger.info('Starting timer via Harvest API');
          const timeEntry = await this.config.harvestClient.startTimer(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(timeEntry, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'start_timer');
        }
      }
    }
  • Registration of the 'start_timer' tool within the time entries module.
    {
      tool: {
        name: 'start_timer',
        description: 'Start a timer for a new time entry. Creates a running time entry that tracks time automatically.',
        inputSchema: {
          type: 'object',
          properties: {
            project_id: { type: 'number', description: 'The project ID to start the timer for' },
            task_id: { type: 'number', description: 'The task ID to start the timer for' },
            spent_date: { type: 'string', format: 'date', description: 'Date for the timer (YYYY-MM-DD format)' },
            notes: { type: 'string', maxLength: 2000, description: 'Initial notes for the timer' },
            external_reference: {
              type: 'object',
              properties: {
                id: { type: 'string' },
                group_id: { type: 'string' },
                account_id: { type: 'string' },
                permalink: { type: 'string', format: 'uri' },
              },
              additionalProperties: false,
            },
          },
          required: ['project_id', 'task_id', 'spent_date'],
          additionalProperties: false,
        },
      },
      handler: new StartTimerHandler(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