update_milestone
Modify GitHub milestone details including title, description, due date, and status to track project progress and deadlines.
Instructions
Update a GitHub milestone
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| milestoneId | Yes | ||
| title | No | ||
| description | No | ||
| dueDate | Yes | ||
| state | No |
Input Schema (JSON Schema)
{
"properties": {
"description": {
"type": "string"
},
"dueDate": {
"type": "string"
},
"milestoneId": {
"type": "string"
},
"state": {
"enum": [
"open",
"closed"
]
},
"title": {
"type": "string"
}
},
"required": [
"milestoneId",
"dueDate"
],
"type": "object"
}
Implementation Reference
- Primary handler for update_milestone tool: validates input, maps to domain model, calls repository to update GitHub milestoneasync updateMilestone(data: { milestoneId: string; title?: string; description?: string; dueDate?: string | null; state?: 'open' | 'closed'; }): Promise<Milestone> { try { // Convert state to ResourceStatus if provided let status: ResourceStatus | undefined; if (data.state) { status = data.state === 'open' ? ResourceStatus.ACTIVE : ResourceStatus.CLOSED; } // Map input data to domain model const milestoneData: Partial<Milestone> = { title: data.title, description: data.description, dueDate: data.dueDate === null ? undefined : data.dueDate, status }; // Clean up undefined values Object.keys(milestoneData).forEach(key => { if (milestoneData[key as keyof Partial<Milestone>] === undefined) { delete milestoneData[key as keyof Partial<Milestone>]; } }); return await this.milestoneRepo.update(data.milestoneId, milestoneData); } catch (error) { throw this.mapErrorToMCPError(error); } }
- Core implementation: calls GitHub REST API octokit.rest.issues.updateMilestone to perform the actual updateasync update(id: MilestoneId, data: Partial<Milestone>): Promise<Milestone> { // Use REST API for milestone updates since GraphQL doesn't support it const response = await this.rest( (params) => this.octokit.rest.issues.updateMilestone(params), { milestone_number: parseInt(id), title: data.title, description: data.description, due_on: data.dueDate, state: data.status === ResourceStatus.CLOSED ? "closed" : "open", } ); return this.mapRestMilestoneToMilestone(response); }
- Zod input schema validation for update_milestone tool// Schema for update_milestone tool export const updateMilestoneSchema = z.object({ milestoneId: z.string().min(1, "Milestone ID is required"), title: z.string().optional(), description: z.string().optional(), dueDate: z.string().datetime().optional().nullable(), state: z.enum(["open", "closed"]).optional(), }); export type UpdateMilestoneArgs = z.infer<typeof updateMilestoneSchema>;
- src/infrastructure/tools/ToolRegistry.ts:151-151 (registration)Registers the update_milestone tool in the central ToolRegistry during initializationthis.registerTool(updateMilestoneTool);
- src/index.ts:268-269 (handler)MCP tool dispatch handler: routes call_tool requests for 'update_milestone' to ProjectManagementServicecase "update_milestone": return await this.service.updateMilestone(args);