harvest_create_time_entry
Create a new time entry in Harvest by specifying project, task, date, hours worked, and optional notes for accurate time tracking.
Instructions
Create a new time entry. Use about {"tool": "harvest_create_time_entry"} for detailed parameters and examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hours | No | Hours worked | |
| notes | No | Notes for the time entry | |
| project_id | Yes | Project ID | |
| spent_date | Yes | Date of the entry (YYYY-MM-DD) | |
| task_id | Yes | Task ID |
Implementation Reference
- src/harvest-client.ts:83-88 (handler)Core handler function that sends a POST request to the Harvest API endpoint /time_entries to create a new time entry using the input data.async createTimeEntry(data: any) { return this.makeRequest('/time_entries', { method: 'POST', body: JSON.stringify(data), }); }
- src/index.ts:94-103 (handler)MCP server dispatch handler (switch case) for 'harvest_create_time_entry' that calls the HarvestClient.createTimeEntry method and formats the response as MCP content.case 'harvest_create_time_entry': const newTimeEntry = await harvestClient.createTimeEntry(typedArgs); return { content: [ { type: 'text', text: JSON.stringify(newTimeEntry, null, 2), }, ], };
- src/tools.ts:20-34 (schema)Schema definition for the harvest_create_time_entry tool, including input schema with properties, descriptions, and required fields.{ name: 'harvest_create_time_entry', description: 'Create a new time entry. Use about {"tool": "harvest_create_time_entry"} for detailed parameters and examples.', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'Project ID' }, task_id: { type: 'string', description: 'Task ID' }, spent_date: { type: 'string', description: 'Date of the entry (YYYY-MM-DD)' }, hours: { type: 'number', description: 'Hours worked' }, notes: { type: 'string', description: 'Notes for the time entry' } }, required: ['project_id', 'task_id', 'spent_date'] } },
- src/index.ts:69-73 (registration)Registration of the ListToolsRequestHandler that returns the full tools array, making harvest_create_time_entry discoverable via MCP.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: tools, }; });