Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_idYes
titleYes
descriptionNo
due_dateNo
start_dateNo

Implementation Reference

  • 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);
    }
  • 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) }] };
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheRealChrisThomas/gitlab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server