delete_milestone
Remove a GitHub milestone to clean up project tracking and maintain organized project management workflows.
Instructions
Delete a GitHub milestone
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| milestoneId | Yes |
Input Schema (JSON Schema)
{
"properties": {
"milestoneId": {
"type": "string"
}
},
"required": [
"milestoneId"
],
"type": "object"
}
Implementation Reference
- Core implementation of milestone deletion using GitHub REST API (octokit.rest.issues.deleteMilestone). This is the actual execution logic for deleting the milestone.async delete(id: MilestoneId): Promise<void> { // Use REST API for milestone deletion since GraphQL doesn't support it await this.rest( (params) => this.octokit.rest.issues.deleteMilestone(params), { milestone_number: parseInt(id) } ); }
- Service layer handler for delete_milestone tool. Calls the repository to delete the milestone and returns formatted success response.async deleteMilestone(data: { milestoneId: string; }): Promise<{ success: boolean; message: string }> { try { await this.milestoneRepo.delete(data.milestoneId); return { success: true, message: `Milestone ${data.milestoneId} has been deleted` }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- src/index.ts:271-272 (handler)MCP tool dispatch handler in executeToolHandler switch statement. Dispatches delete_milestone tool call to the ProjectManagementService.case "delete_milestone": return await this.service.deleteMilestone(args);
- Zod schema definition for delete_milestone tool input validation (milestoneId: string).// Schema for delete_milestone tool export const deleteMilestoneSchema = z.object({ milestoneId: z.string().min(1, "Milestone ID is required"), }); export type DeleteMilestoneArgs = z.infer<typeof deleteMilestoneSchema>; // Schema for update_sprint tool export const updateSprintSchema = z.object({ sprintId: z.string().min(1, "Sprint ID is required"), title: z.string().optional(), description: z.string().optional(), startDate: z.string().datetime().optional(), endDate: z.string().datetime().optional(), status: z.enum(["planned", "active", "completed"]).optional(), }); export type UpdateSprintArgs = z.infer<typeof updateSprintSchema>; // Schema for add_issues_to_sprint tool export const addIssuesToSprintSchema = z.object({
- src/infrastructure/tools/ToolRegistry.ts:152-152 (registration)Registration of deleteMilestoneTool in the central ToolRegistry during initialization.this.registerTool(deleteMilestoneTool);
- ToolDefinition for delete_milestone including name, description, schema reference, and usage examples.export const deleteMilestoneTool: ToolDefinition<DeleteMilestoneArgs> = { name: "delete_milestone", description: "Delete a GitHub milestone", schema: deleteMilestoneSchema as unknown as ToolSchema<DeleteMilestoneArgs>, examples: [ { name: "Delete milestone", description: "Delete a milestone by ID", args: { milestoneId: "42" } } ] };