archive_project
Archive or unarchive a project in Helios-9 by specifying its ID and reason, managing project lifecycle and organization.
Instructions
Archive or unarchive a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ID of the project to archive/unarchive | |
| archive | No | True to archive, false to unarchive | |
| reason | No | Reason for archiving/unarchiving |
Implementation Reference
- src/tools/projects.ts:326-354 (handler)The main handler function for the archive_project tool. Parses arguments with Zod schema, updates project status to 'archived' or 'active', logs activity, and optionally marks associated tasks as done when archiving.export const archiveProject = requireAuth(async (args: any) => { const { project_id, archive, reason } = ArchiveProjectSchema.parse(args) logger.info(`${archive ? 'Archiving' : 'Unarchiving'} project`, { project_id, reason }) const updates: any = { status: archive ? 'archived' : 'active', updated_at: new Date().toISOString() } // metadata field doesn't exist in the database schema const result = await supabaseService.updateProject(project_id, updates) if (archive) { // Mark all associated tasks as done when archiving project await supabaseService.updateTasksByProject(project_id, { status: 'done', updated_at: new Date().toISOString() }) } return { success: true, action: archive ? 'archived' : 'unarchived', project: result, affected_tasks: archive ? 'All project tasks archived' : 'Tasks remain as-is' } })
- src/tools/projects.ts:296-318 (registration)MCPTool registration object defining the 'archive_project' tool with name, description, and JSON input schema.export const archiveProjectTool: MCPTool = { name: 'archive_project', description: 'Archive or unarchive a project', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'ID of the project to archive/unarchive' }, archive: { type: 'boolean', default: true, description: 'True to archive, false to unarchive' }, reason: { type: 'string', description: 'Reason for archiving/unarchiving' } }, required: ['project_id'] } }
- src/tools/projects.ts:320-324 (schema)Zod schema used internally for parsing and validating input arguments in the handler.const ArchiveProjectSchema = z.object({ project_id: z.string().min(1), archive: z.boolean().default(true), reason: z.string().optional() })
- src/tools/projects.ts:778-788 (registration)Central registry mapping tool names to their handler functions, including 'archive_project' to archiveProject.export const projectHandlers = { list_projects: listProjects, get_project: getProject, create_project: createProject, update_project: updateProject, get_project_context: getProjectContext, archive_project: archiveProject, duplicate_project: duplicateProject, get_project_timeline: getProjectTimeline, bulk_update_projects: bulkUpdateProjects }
- src/tools/projects.ts:766-776 (registration)Export of all project MCPTool objects, including archiveProjectTool.export const projectTools = { listProjectsTool, getProjectTool, createProjectTool, updateProjectTool, getProjectContextTool, archiveProjectTool, duplicateProjectTool, getProjectTimelineTool, bulkUpdateProjectsTool }