delete_project
Archive a Harvest project to make it inactive while preserving historical data for time tracking records.
Instructions
Delete (archive) a project. This action archives the project rather than permanently deleting it, preserving historical data while making it inactive.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The ID of the project to delete |
Implementation Reference
- src/tools/projects.ts:99-115 (handler)The DeleteProjectHandler class implements the logic for the delete_project tool, which calls the Harvest API to delete/archive a project.
class DeleteProjectHandler implements ToolHandler { constructor(private readonly config: BaseToolConfig) {} async execute(args: Record<string, any>): Promise<CallToolResult> { try { const inputSchema = z.object({ project_id: z.number().int().positive() }); const { project_id } = validateInput(inputSchema, args, 'delete project'); logger.info('Deleting project via Harvest API', { projectId: project_id }); await this.config.harvestClient.deleteProject(project_id); return { content: [{ type: 'text', text: JSON.stringify({ message: `Project ${project_id} deleted successfully` }, null, 2) }], }; } catch (error) { return handleMCPToolError(error, 'delete_project'); } - src/tools/projects.ts:308-320 (registration)The delete_project tool is registered with its description, input schema, and handler instance.
tool: { name: 'delete_project', description: 'Delete (archive) a project. This action archives the project rather than permanently deleting it, preserving historical data while making it inactive.', inputSchema: { type: 'object', properties: { project_id: { type: 'number', description: 'The ID of the project to delete' }, }, required: ['project_id'], additionalProperties: false, }, }, handler: new DeleteProjectHandler(config),