get_time_entry
Retrieve detailed time entry information including project, task, user, and timing data by specifying the entry ID. Use this tool to access specific time tracking records from Harvest.
Instructions
Retrieve a specific time entry by its ID. Returns complete time entry details including project, task, user, and timing information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time_entry_id | Yes | The ID of the time entry to retrieve |
Implementation Reference
- src/tools/time-entries.ts:41-59 (handler)Handler implementation for 'get_time_entry'. It validates the input `time_entry_id` and calls the `harvestClient` to retrieve the time entry.
class GetTimeEntryHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const inputSchema = z.object({ time_entry_id: z.number().int().positive() }); const { time_entry_id } = validateInput(inputSchema, args, 'get time entry'); logger.info('Fetching time entry from Harvest API', { timeEntryId: time_entry_id }); const timeEntry = await this.config.harvestClient.getTimeEntry(time_entry_id); return { content: [{ type: 'text', text: JSON.stringify(timeEntry, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'get_time_entry'); } } } - src/tools/time-entries.ts:198-208 (schema)Schema and registration block for 'get_time_entry' within the `registerTimeEntryTools` function.
tool: { name: 'get_time_entry', description: 'Retrieve a specific time entry by its ID. Returns complete time entry details including project, task, user, and timing information.', inputSchema: { type: 'object', properties: { time_entry_id: { type: 'number', description: 'The ID of the time entry to retrieve' }, }, required: ['time_entry_id'], additionalProperties: false, },