delete_task
Archive a task in Harvest time tracking to make it inactive while preserving historical data for reporting and record-keeping purposes.
Instructions
Delete (archive) a task. This action archives the task rather than permanently deleting it, preserving historical data while making it inactive.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to delete |
Implementation Reference
- src/tools/tasks.ts:94-112 (handler)Handler class that implements the deletion logic for a task using the Harvest client.
class DeleteTaskHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const inputSchema = z.object({ task_id: z.number().int().positive() }); const { task_id } = validateInput(inputSchema, args, 'delete task'); logger.info('Deleting task via Harvest API', { taskId: task_id }); await this.config.harvestClient.deleteTask(task_id); return { content: [{ type: 'text', text: JSON.stringify({ message: `Task ${task_id} deleted successfully` }, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'delete_task'); } } } - src/tools/tasks.ts:187-201 (registration)Tool registration configuration for delete_task.
{ tool: { name: 'delete_task', description: 'Delete (archive) a task. This action archives the task rather than permanently deleting it, preserving historical data while making it inactive.', inputSchema: { type: 'object', properties: { task_id: { type: 'number', description: 'The ID of the task to delete' }, }, required: ['task_id'], additionalProperties: false, }, }, handler: new DeleteTaskHandler(config), },