delete_project
Remove GitHub projects to clean up your workspace and manage repositories efficiently. This tool deletes projects using their unique project ID.
Instructions
Delete a GitHub project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes |
Input Schema (JSON Schema)
{
"properties": {
"projectId": {
"type": "string"
}
},
"required": [
"projectId"
],
"type": "object"
}
Implementation Reference
- Core handler method in ProjectManagementService that executes the delete_project tool logic. Validates input implicitly via schema, calls repository delete, and formats success response.async deleteProject(data: { projectId: string; }): Promise<{ success: boolean; message: string }> { try { await this.projectRepo.delete(data.projectId); return { success: true, message: `Project ${data.projectId} has been deleted`, }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- Repository implementation that performs the actual GitHub GraphQL deleteProjectV2 mutation to delete the project.async delete(id: ProjectId): Promise<void> { const mutation = ` mutation($input: DeleteProjectV2Input!) { deleteProjectV2(input: $input) { projectV2 { id } } } `; await this.graphql(mutation, { input: { projectId: id, }, }); }
- Tool definition including schema, description, and examples for delete_project tool.export const deleteProjectTool: ToolDefinition<DeleteProjectArgs> = { name: "delete_project", description: "Delete a GitHub project", schema: deleteProjectSchema as unknown as ToolSchema<DeleteProjectArgs>, examples: [ { name: "Delete project", description: "Delete a GitHub project by ID", args: { projectId: "PVT_kwDOLhQ7gc4AOEbH" } } ] };
- src/infrastructure/tools/ToolRegistry.ts:145-146 (registration)Registration of the deleteProjectTool in the ToolRegistry during initialization.this.registerTool(updateProjectTool); this.registerTool(deleteProjectTool);
- src/index.ts:252-253 (handler)Top-level tool dispatcher in MCP server that routes delete_project calls to the service handler.case "delete_project": return await this.service.deleteProject(args);