Skip to main content
Glama

delete_time_entry

Remove a time entry permanently from Harvest time tracking. This action cannot be undone, so use it to correct errors or clean up records.

Instructions

Delete a time entry permanently. This action cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
time_entry_idYesThe ID of the time entry to delete

Implementation Reference

  • The handler class DeleteTimeEntryHandler implements the tool execution logic for deleting a time entry, including input validation, calling the Harvest API, and error handling.
    class DeleteTimeEntryHandler 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, 'delete time entry');
    
          logger.info('Deleting time entry via Harvest API', { timeEntryId: time_entry_id });
          await this.config.harvestClient.deleteTimeEntry(time_entry_id);
          
          return {
            content: [{ type: 'text', text: JSON.stringify({ message: `Time entry ${time_entry_id} deleted successfully` }, null, 2) }],
          };
        } catch (error) {
          return handleMCPToolError(error, 'delete_time_entry');
        }
  • The registration of the 'delete_time_entry' tool within the time entries tool definitions.
      tool: {
        name: 'delete_time_entry',
        description: 'Delete a time entry permanently. This action cannot be undone.',
        inputSchema: {
          type: 'object',
          properties: {
            time_entry_id: { type: 'number', description: 'The ID of the time entry to delete' },
          },
          required: ['time_entry_id'],
          additionalProperties: false,
        },
      },
      handler: new DeleteTimeEntryHandler(config),
    },

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