Skip to main content
Glama

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
NameRequiredDescriptionDefault
time_entry_idYesThe ID of the time entry to retrieve

Implementation Reference

  • 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');
        }
      }
    }
  • 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,
      },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ianaleck/harvest-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server