create_milestone
Create a new milestone in a GitLab project to track progress, set deadlines, and organize work by specifying project ID, title, description, and dates.
Instructions
Create a new milestone in a GitLab project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| title | Yes | ||
| description | No | ||
| due_date | No | ||
| start_date | No |
Implementation Reference
- src/api/milestones.ts:33-57 (handler)The actual implementation of the 'createMilestone' function.
export async function createMilestone( projectId: string, title: string, description?: string, dueDate?: string, startDate?: string ): Promise<GitLabMilestoneResponse> { if (!projectId?.trim()) { throw new Error("Project ID is required"); } if (!title?.trim()) { throw new Error("Milestone title is required"); } const endpoint = `/projects/${encodeProjectId(projectId)}/milestones`; const milestone = await gitlabPost<GitLabMilestoneResponse>(endpoint, { title, description, due_date: dueDate, start_date: startDate }); return GitLabMilestoneSchema.parse(milestone); } - src/schemas.ts:319-325 (schema)Zod schema for the inputs of create_milestone.
export const CreateMilestoneSchema = z.object({ project_id: z.string(), title: z.string(), description: z.string().optional(), due_date: z.string().optional(), start_date: z.string().optional() }); - src/server.ts:332-342 (registration)Tool handler registration and execution for create_milestone in the server.
case "create_milestone": { const args = CreateMilestoneSchema.parse(request.params.arguments); const milestone = await api.createMilestone( args.project_id, args.title, args.description, args.due_date, args.start_date ); return { content: [{ type: "text", text: JSON.stringify(milestone, null, 2) }] }; }