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
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | Yes | Group ID or URL-encoded path | |
| state | No | Return only active or closed milestones | |
| title | No | Return only milestones with the given title (case-sensitive) | |
| search | No | Return only milestones with title or description matching the string | |
| search_title | No | Return only milestones with title matching the string | |
| include_ancestors | No | Include milestones for all parent groups | |
| include_descendants | No | Include milestones for group and its descendants | |
| updated_before | No | Return only milestones updated before the given datetime (ISO 8601) | |
| updated_after | No | Return only milestones updated after the given datetime (ISO 8601) | |
| containing_date | No | Return only milestones containing the given date | |
| start_date | No | Return only milestones where due_date >= start_date | |
| end_date | No | Return only milestones where start_date <= end_date | |
| page | No | Page number for pagination (default: 1) | |
| per_page | No | Number of results per page (default: 20) |
Implementation Reference
- src/api/group-milestones.ts:6-39 (handler)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); } - src/server.ts:358-363 (handler)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) }] }; } - src/schemas.ts:350-362 (schema)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) },