harvest_create_time_entry
Create time entries in Harvest to track work hours on specific projects and tasks, enabling accurate time management and reporting.
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 |
|---|---|---|---|
| project_id | Yes | Project ID | |
| task_id | Yes | Task ID | |
| spent_date | Yes | Date of the entry (YYYY-MM-DD) | |
| hours | No | Hours worked | |
| notes | No | Notes for the time entry |
Implementation Reference
- src/harvest-client.ts:83-88 (handler)Core implementation of the tool: makes POST request to Harvest API /time_entries endpoint with the provided 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: receives tool call and invokes HarvestClient.createTimeEntry, formats response.
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 (registration)Tool registration: defines name, description, and input schema for harvest_create_time_entry.
{ 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/tools.ts:20-34 (schema)Input schema definition: specifies required and optional parameters with types and descriptions.
{ 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'] } },