Skip to main content
Glama

list_group_milestones

Retrieve milestones from a GitLab group with filtering options for state, title, date ranges, and hierarchical scope.

Instructions

List all milestones in a GitLab group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYesGroup ID or URL-encoded path
stateNoReturn only active or closed milestones
titleNoReturn only milestones with the given title (case-sensitive)
searchNoReturn only milestones with title or description matching the string
search_titleNoReturn only milestones with title matching the string
include_ancestorsNoInclude milestones for all parent groups
include_descendantsNoInclude milestones for group and its descendants
updated_beforeNoReturn only milestones updated before the given datetime (ISO 8601)
updated_afterNoReturn only milestones updated after the given datetime (ISO 8601)
containing_dateNoReturn only milestones containing the given date
start_dateNoReturn only milestones where due_date >= start_date
end_dateNoReturn only milestones where start_date <= end_date
pageNoPage number for pagination (default: 1)
per_pageNoNumber of results per page (default: 20)

Implementation Reference

  • The handler function that executes the GitLab API call to list milestones for a group.
    export async function listGroupMilestones(
      groupId: string,
      options: {
        state?: "active" | "closed";
        title?: string;
        search?: string;
        search_title?: string;
        include_ancestors?: boolean;
        include_descendants?: boolean;
        updated_before?: string;
        updated_after?: string;
        containing_date?: string;
        start_date?: string;
        end_date?: string;
        page?: number;
        per_page?: number;
      } = {}
    ): Promise<GitLabGroupMilestoneResponse[]> {
      if (!groupId?.trim()) {
        throw new Error("Group ID is required");
      }
      if (options.page !== undefined && options.page < 1) {
        throw new Error("Page number must be 1 or greater");
      }
      if (options.per_page !== undefined && (options.per_page < 1 || options.per_page > 100)) {
        throw new Error("Per page must be between 1 and 100");
      }
    
      const endpoint = `/groups/${encodeURIComponent(groupId)}/milestones`;
      const params = buildSearchParams(options);
    
      const milestones = await gitlabGet<GitLabGroupMilestoneResponse[]>(endpoint, params);
      return z.array(GitLabGroupMilestoneSchema).parse(milestones);
    }
  • The tool request handler switch case in src/server.ts that invokes the API implementation.
    case "list_group_milestones": {
      const args = ListGroupMilestonesSchema.parse(request.params.arguments);
      const { group_id, ...options } = args;
      const milestones = await api.listGroupMilestones(group_id, options);
      return { content: [{ type: "text", text: JSON.stringify(milestones, null, 2) }] };
    }
  • Input validation schema for the list_group_milestones tool.
    export const ListGroupMilestonesSchema = z.object({
      group_id: z.string().describe("Group ID or URL-encoded path"),
      state: z.enum(["active", "closed"]).optional().describe("Return only active or closed milestones"),
      title: z.string().optional().describe("Return only milestones with the given title (case-sensitive)"),
      search: z.string().optional().describe("Return only milestones with title or description matching the string"),
      search_title: z.string().optional().describe("Return only milestones with title matching the string"),
      include_ancestors: z.boolean().optional().describe("Include milestones for all parent groups"),
      include_descendants: z.boolean().optional().describe("Include milestones for group and its descendants"),
      updated_before: z.string().optional().describe("Return only milestones updated before the given datetime (ISO 8601)"),
      updated_after: z.string().optional().describe("Return only milestones updated after the given datetime (ISO 8601)"),
      containing_date: z.string().optional().describe("Return only milestones containing the given date"),
      start_date: z.string().optional().describe("Return only milestones where due_date >= start_date"),
      end_date: z.string().optional().describe("Return only milestones where start_date <= end_date"),
  • src/server.ts:150-153 (registration)
    Tool registration definition in the MCP server setup.
      name: "list_group_milestones",
      description: "List all milestones in a GitLab group",
      inputSchema: zodToJsonSchema(ListGroupMilestonesSchema)
    },

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