archive_project_item
Archive items in GitHub projects to hide them from views without deletion. Use this tool to clean up project boards while preserving item history.
Instructions
Archive an item in a GitHub project. Archived items are hidden from views but not deleted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ||
| itemId | Yes |
Implementation Reference
- Core handler function that executes the archive_project_item tool by calling GitHub's GraphQL API mutation 'archiveProjectV2Item' to archive the specified project item.async archiveProjectItem(data: { projectId: string; itemId: string; }): Promise<{ success: boolean; message: string }> { try { const mutation = ` mutation($input: ArchiveProjectV2ItemInput!) { archiveProjectV2Item(input: $input) { item { id isArchived } } } `; interface ArchiveProjectItemResponse { archiveProjectV2Item: { item: { id: string; isArchived: boolean; }; }; } await this.factory.graphql<ArchiveProjectItemResponse>(mutation, { input: { projectId: data.projectId, itemId: data.itemId } }); return { success: true, message: `Item ${data.itemId} has been archived in project ${data.projectId}` }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- ToolDefinition object defining the tool name, description, input schema (archiveProjectItemSchema), and usage examples.export const archiveProjectItemTool: ToolDefinition<ArchiveProjectItemArgs> = { name: "archive_project_item", description: "Archive an item in a GitHub project. Archived items are hidden from views but not deleted.", schema: archiveProjectItemSchema as unknown as ToolSchema<ArchiveProjectItemArgs>, examples: [ { name: "Archive completed task", description: "Archive a project item that is complete", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH", itemId: "PVTI_lADOLhQ7gc4AOEbHzM4AOAJ7" } } ] };
- Zod input validation schema requiring projectId and itemId strings.export const archiveProjectItemSchema = z.object({ projectId: z.string().min(1, "Project ID is required"), itemId: z.string().min(1, "Item ID is required"), }); export type ArchiveProjectItemArgs = z.infer<typeof archiveProjectItemSchema>;
- src/infrastructure/tools/ToolRegistry.ts:256-257 (registration)Registers the archiveProjectItemTool in the central ToolRegistry singleton instance.this.registerTool(archiveProjectItemTool); this.registerTool(unarchiveProjectItemTool);
- src/index.ts:415-416 (handler)MCP tool dispatcher switch case that routes 'archive_project_item' calls to the ProjectManagementService handler.case "archive_project_item": return await this.service.archiveProjectItem(args);