update_milestone
Modify milestone details like title, description, due date, or state in a GitLab project to track project progress and deadlines.
Instructions
Update an existing milestone in a GitLab project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| milestone_id | Yes | ||
| title | No | ||
| description | No | ||
| due_date | No | ||
| start_date | No | ||
| state_event | No |
Implementation Reference
- src/api/milestones.ts:59-81 (handler)The actual handler implementation for update_milestone, which performs a PUT request to the GitLab API.
export async function updateMilestone( projectId: string, milestoneId: number, options: { title?: string; description?: string; due_date?: string; start_date?: string; state_event?: "close" | "activate"; } ): Promise<GitLabMilestoneResponse> { if (!projectId?.trim()) { throw new Error("Project ID is required"); } if (!milestoneId || milestoneId < 1) { throw new Error("Valid milestone ID is required"); } const endpoint = `/projects/${encodeProjectId(projectId)}/milestones/${milestoneId}`; const milestone = await gitlabPut<GitLabMilestoneResponse>(endpoint, options); return GitLabMilestoneSchema.parse(milestone); } - src/schemas.ts:327-335 (schema)The Zod schema defining the inputs for update_milestone.
export const UpdateMilestoneSchema = z.object({ project_id: z.string(), milestone_id: z.number(), title: z.string().optional(), description: z.string().optional(), due_date: z.string().optional(), start_date: z.string().optional(), state_event: z.enum(["close", "activate"]).optional() }); - src/server.ts:344-349 (registration)The registration and routing logic for the update_milestone tool in the server request handler.
case "update_milestone": { const args = UpdateMilestoneSchema.parse(request.params.arguments); const { project_id, milestone_id, ...options } = args; const milestone = await api.updateMilestone(project_id, milestone_id, options); return { content: [{ type: "text", text: JSON.stringify(milestone, null, 2) }] }; }