Skip to main content
Glama

list_time_entries

Retrieve filtered time entries from Harvest by user, client, project, task, billing status, or date range with paginated results.

Instructions

Retrieve a list of time entries with optional filtering. Supports filtering by user, client, project, task, billing status, date ranges, and more. Returns paginated results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idNoFilter by user ID
client_idNoFilter by client ID
project_idNoFilter by project ID
task_idNoFilter by task ID
is_billedNoFilter by billing status
is_runningNoFilter by running timer status
updated_sinceNoFilter by entries updated since this timestamp
fromNoStart date for date range filter (YYYY-MM-DD)
toNoEnd date for date range filter (YYYY-MM-DD)
pageNoPage number for pagination
per_pageNoNumber of entries per page (max 2000)

Implementation Reference

  • The handler implementation for the 'list_time_entries' tool. It validates input using TimeEntryQuerySchema and executes the Harvest API call via config.harvestClient.getTimeEntries.
    class ListTimeEntriesHandler implements ToolHandler {
      constructor(private readonly config: BaseToolConfig) {}
    
      async execute(args: Record<string, any>): Promise<CallToolResult> {
        try {
          const validatedArgs = validateInput(TimeEntryQuerySchema, args, 'time entries query');
          logger.info('Listing time entries from Harvest API');
          const timeEntries = await this.config.harvestClient.getTimeEntries(validatedArgs);
          
          return {
            content: [{ type: 'text', text: JSON.stringify(timeEntries, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'list_time_entries');
        }
      }
    }
  • The registration of the 'list_time_entries' tool, which associates the name, description, input schema, and the handler class.
    {
      tool: {
        name: 'list_time_entries',
        description: 'Retrieve a list of time entries with optional filtering. Supports filtering by user, client, project, task, billing status, date ranges, and more. Returns paginated results.',
        inputSchema: {
          type: 'object',
          properties: {
            user_id: { type: 'number', description: 'Filter by user ID' },
            client_id: { type: 'number', description: 'Filter by client ID' },
            project_id: { type: 'number', description: 'Filter by project ID' },
            task_id: { type: 'number', description: 'Filter by task ID' },
            is_billed: { type: 'boolean', description: 'Filter by billing 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' },
            from: { type: 'string', format: 'date', description: 'Start date for date range filter (YYYY-MM-DD)' },
            to: { type: 'string', format: 'date', description: 'End date for date range filter (YYYY-MM-DD)' },
            page: { type: 'number', minimum: 1, description: 'Page number for pagination' },
            per_page: { type: 'number', minimum: 1, maximum: 2000, description: 'Number of entries per page (max 2000)' },
          },
          additionalProperties: false,
        },
      },
      handler: new ListTimeEntriesHandler(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