harvest_list_time_entries
Retrieve time entries from Harvest with filters for user, project, date range, and pagination to track work hours and manage time reporting.
Instructions
List time entries with optional filters. Use about {"tool": "harvest_list_time_entries"} for detailed usage examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Start date (YYYY-MM-DD) | |
| page | No | Page number | |
| per_page | No | Results per page (max 100) | |
| project_id | No | Filter by project ID | |
| to | No | End date (YYYY-MM-DD) | |
| user_id | No | Filter by user ID |
Implementation Reference
- src/harvest-client.ts:74-77 (handler)Core handler function that executes the Harvest API request to list time entries with optional query parameters for filtering.async getTimeEntries(options?: any) { const queryString = this.buildQueryString(options); return this.makeRequest(`/time_entries${queryString}`); }
- src/tools.ts:5-19 (schema)Tool schema definition including name, description, and input schema for validation.{ name: 'harvest_list_time_entries', description: 'List time entries with optional filters. Use about {"tool": "harvest_list_time_entries"} for detailed usage examples.', inputSchema: { type: 'object', properties: { user_id: { type: 'string', description: 'Filter by user ID' }, project_id: { type: 'string', description: 'Filter by project ID' }, from: { type: 'string', description: 'Start date (YYYY-MM-DD)' }, to: { type: 'string', description: 'End date (YYYY-MM-DD)' }, page: { type: 'number', description: 'Page number' }, per_page: { type: 'number', description: 'Results per page (max 100)' } } } },
- src/index.ts:83-92 (registration)MCP server request handler registration and dispatch for the tool, calling the client method and formatting response.case 'harvest_list_time_entries': const timeEntries = await harvestClient.getTimeEntries(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(timeEntries, null, 2), }, ], };
- src/index.ts:69-73 (registration)Registration of the tool list handler, which includes this tool's schema in the exported tools array from tools.ts.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });
- src/harvest-client.ts:237-285 (helper)Detailed documentation and usage examples for the tool provided via the 'about' tool.'harvest_list_time_entries': `# harvest_list_time_entries Lists time entries with powerful filtering and pagination options. ## Purpose Retrieve time entries from your Harvest account with optional filters for users, projects, date ranges, and pagination. ## Parameters - \`user_id\` (string, optional): Filter entries by specific user ID - \`project_id\` (string, optional): Filter entries by specific project ID - \`from\` (string, optional): Start date in YYYY-MM-DD format - \`to\` (string, optional): End date in YYYY-MM-DD format - \`page\` (number, optional): Page number for pagination (default: 1) - \`per_page\` (number, optional): Results per page, max 100 (default: 100) ## Example Usage **List all time entries:** \`\`\`json {"tool": "harvest_list_time_entries"} \`\`\` **List entries for last week:** \`\`\`json { "tool": "harvest_list_time_entries", "from": "2024-01-15", "to": "2024-01-21" } \`\`\` **List entries for specific project with pagination:** \`\`\`json { "tool": "harvest_list_time_entries", "project_id": "12345", "page": 1, "per_page": 25 } \`\`\` ## Response Format Returns an object with: - \`time_entries\`: Array of time entry objects - \`per_page\`, \`total_pages\`, \`total_entries\`: Pagination info - \`page\`, \`links\`: Current page and navigation links Each time entry includes: id, hours, notes, spent_date, project info, task info, user info, timer status (is_running, timer_started_at).`,