list_entries
Retrieve recent time entries from Harvest by specifying date ranges to review tracked work hours and activities.
Instructions
List recent time entries
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_entries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Start date (YYYY-MM-DD) | |
| to | No | End date (YYYY-MM-DD) |
Implementation Reference
- src/index.ts:415-437 (handler)Handler for the 'list_entries' tool. Extracts optional 'from' and 'to' dates from arguments, queries the Harvest API for time entries, maps the response to a simplified format, and returns it as JSON text content.
case 'list_entries': { const { from, to } = request.params.arguments as { from?: string; to?: string }; const params: Record<string, string> = {}; if (from) params.from = from; if (to) params.to = to; const response = await this.axiosInstance.get('/time_entries', { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data.time_entries.map((e: { id: number; spent_date: string; hours: number; notes: string; project: { name: string }; task: { name: string } }) => ({ id: e.id, spent_date: e.spent_date, hours: e.hours, notes: e.notes, project: e.project.name, task: e.task.name, })), null, 2), }, ], }; } - src/index.ts:303-318 (registration)Registration of the 'list_entries' tool in the tools array, including its name, description, and input schema definition.
name: 'list_entries', description: 'List recent time entries', inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'Start date (YYYY-MM-DD)', }, to: { type: 'string', description: 'End date (YYYY-MM-DD)', }, }, }, }, - src/index.ts:305-317 (schema)Input schema for the 'list_entries' tool defining optional 'from' and 'to' date parameters.
inputSchema: { type: 'object', properties: { from: { type: 'string', description: 'Start date (YYYY-MM-DD)', }, to: { type: 'string', description: 'End date (YYYY-MM-DD)', }, }, },