Skip to main content
Glama

get_time_report

Generate time tracking reports from Harvest with filtering by date range, users, clients, projects, tasks, and billable status. Supports grouping by user, client, project, task, or date.

Instructions

Generate comprehensive time tracking reports with filtering by date range, users, clients, projects, and tasks. Supports grouping and billable status filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesStart date for report (YYYY-MM-DD) (required)
toYesEnd date for report (YYYY-MM-DD) (required)
user_idNoFilter by specific user ID
client_idNoFilter by specific client ID
project_idNoFilter by specific project ID
task_idNoFilter by specific task ID
billableNoFilter by billable status
is_billedNoFilter by billed status
is_runningNoFilter by running timer status
updated_sinceNoFilter by entries updated since this timestamp
group_byNoGroup report results by specified dimension

Implementation Reference

  • The handler class that implements the logic for 'get_time_report'. It validates inputs using a schema and calls the harvest client.
    class GetTimeReportHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(TimeReportQuerySchema, args, 'time report query');
          logger.info('Generating time report from Harvest API');
          const report = await this.config.harvestClient.getTimeReport(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(report, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'get_time_report');
        }
      }
    }
  • The tool registration block for 'get_time_report', including input schema definition and instantiation of the handler.
    {
      tool: {
        name: 'get_time_report',
        description: 'Generate comprehensive time tracking reports with filtering by date range, users, clients, projects, and tasks. Supports grouping and billable status filtering.',
        inputSchema: {
          type: 'object',
          properties: {
            from: { type: 'string', format: 'date', description: 'Start date for report (YYYY-MM-DD) (required)' },
            to: { type: 'string', format: 'date', description: 'End date for report (YYYY-MM-DD) (required)' },
            user_id: { type: 'number', description: 'Filter by specific user ID' },
            client_id: { type: 'number', description: 'Filter by specific client ID' },
            project_id: { type: 'number', description: 'Filter by specific project ID' },
            task_id: { type: 'number', description: 'Filter by specific task ID' },
            billable: { type: 'boolean', description: 'Filter by billable status' },
            is_billed: { type: 'boolean', description: 'Filter by billed status' },
            is_running: { type: 'boolean', description: 'Filter by running timer status' },
            updated_since: { type: 'string', format: 'date-time', description: 'Filter by entries updated since this timestamp' },
            group_by: { type: 'string', enum: ['user', 'client', 'project', 'task', 'date'], description: 'Group report results by specified dimension' },
          },
          required: ['from', 'to'],
          additionalProperties: false,
        },
      },
      handler: new GetTimeReportHandler(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