@zereight/mcp-gitlab 2.3.22 → 2.3.23-next.209

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -133,19 +133,20 @@ import { GitLabClientPool } from "./gitlab-client-pool.js";
133
133
  import { advertisesReadOnly, allTools, readOnlyTools, destructiveTools, deleteTools, parseEnabledToolsets, parseIndividualTools, buildFeatureFlagOverrides, isToolInEnabledToolset, findSmallestToolsetForTool, isExplicitOnlyToolsetId, isExplicitToolsetOnlyTool, isToolsetFullyActive, listDiscoverableCategories, TOOLSET_DEFINITIONS, DISCOVERABLE_TOOLSET_IDS, } from "./tools/registry.js";
134
134
  import { executeGitLabApiRequestAsync, GitLabApiRequestHttpError, GitLabApiRequestInputError, } from "./tools/gitlab-api-request.js";
135
135
  import { configureWikiTools, handleWikiToolCall } from "./tools/wiki.js";
136
+ import { configureMilestoneTools, handleMilestoneToolCall } from "./tools/milestones.js";
137
+ import { configureLabelTools, handleLabelToolCall } from "./tools/labels.js";
136
138
  import { buildUnavailableToolMessage, isSkippedByDiscoverActivation, } from "./tools/discover-activation.js";
137
139
  import { selectCallableHiddenToolNames, selectExposedTools } from "./tools/exposed-tools.js";
138
140
  import { createListedToolsCache, decorateToolsForList, } from "./tools/listed-tools.js";
139
141
  import { isExcludedBySlimProfile, shouldApplySlimToolProfile } from "./tools/tool-profile.js";
140
142
  import { shouldCompactToolResult } from "./utils/compact-tool-allowlist.js";
141
- import { BulkPublishDraftNotesSchema, CancelPipelineJobSchema, ErasePipelineJobSchema, CancelPipelineSchema, CreateBranchSchema, CreateDraftNoteSchema, CreateIssueLinkSchema, CreateIssueNoteSchema, CreateIssueSchema, CreateIssueEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, ListIssueEmojiReactionsSchema, ListIssueNoteEmojiReactionsSchema, CreateLabelSchema, // Added
142
- CreateMergeRequestNoteSchema, CreateMergeRequestDiscussionNoteSchema, CreateMergeRequestEmojiReactionSchema, CreateMergeRequestNoteEmojiReactionSchema, ListMergeRequestEmojiReactionsSchema, ListMergeRequestNoteEmojiReactionsSchema, CreateMergeRequestSchema, CreateMergeRequestThreadSchema, CreateNoteSchema, CreateCommitStatusSchema, CreateOrUpdateFileSchema, CreatePipelineSchema, CreateProjectMilestoneSchema, CreateGroupMilestoneSchema, CreateRepositorySchema, CreateGroupSchema, DeleteBranchSchema, GetProtectedBranchSchema, ListProtectedBranchesSchema, ProtectBranchSchema, UpdateProtectedBranchSchema, UnprotectBranchSchema, UpdateDefaultBranchSchema, DeleteDraftNoteSchema, DeleteGroupMilestoneSchema, DeleteIssueLinkSchema, DeleteIssueSchema, DeleteIssueEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, DeleteLabelSchema, DeleteProjectMilestoneSchema, DeleteMergeRequestNoteSchema, DeleteMergeRequestEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, EditProjectMilestoneSchema, EditGroupMilestoneSchema, ForkRepositorySchema, GetBranchDiffsSchema, GetBranchSchema, GetCommitDiffSchema, GetCommitSchema, GetFileBlameSchema, GitLabBlameEntrySchema, GetDraftNoteSchema, GetFileContentsSchema, GetIssueLinkSchema, GetIssueSchema, GetLabelSchema, GetMergeRequestDiffsSchema, GetMergeRequestSchema, GetMilestoneBurndownEventsSchema, GetMilestoneIssuesSchema, GetMilestoneMergeRequestsSchema, GetGroupMilestoneSchema, GetGroupMilestoneIssuesSchema, GetGroupMilestoneMergeRequestsSchema, GetGroupMilestoneBurndownEventsSchema, GetDeploymentSchema, CreateDeploymentSchema, UpdateDeploymentSchema, DeploymentApprovalSchema, ListDeploymentMergeRequestsSchema, GetEnvironmentSchema, UpdateEnvironmentSchema, StopEnvironmentSchema, StopStaleEnvironmentsSchema, DeleteReviewAppEnvironmentsSchema, PipelineTriggerIdSchema, ListPipelineTriggersSchema, CreatePipelineTriggerSchema, UpdatePipelineTriggerSchema, TriggerPipelineSchema, GetNamespaceSchema, GitLabCiLintResultSchema, GetPipelineJobOutputSchema, PipelineJobControlSchema, GetPipelineSchema, GetPipelineVariablesSchema, UpdatePipelineMetadataSchema, DeletePipelineSchema, PipelineReportSchema, WaitForPipelineSchema, WaitForPipelineJobSchema, PlayPipelineJobsSchema, GetProjectMilestoneSchema, GetProjectSchema, GetRepositoryTreeSchema, GetUsersSchema, GetUserSchema, GitLabUserFullSchema, WhoAmISchema, GitLabCurrentUserSchema, GitLabCommitSchema, GitLabCommitStatusSchema, GitLabCompareResultSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabDiffSchema,
143
+ import { BulkPublishDraftNotesSchema, CancelPipelineJobSchema, ErasePipelineJobSchema, CancelPipelineSchema, CreateBranchSchema, CreateDraftNoteSchema, CreateIssueLinkSchema, CreateIssueNoteSchema, CreateIssueSchema, CreateIssueEmojiReactionSchema, CreateIssueNoteEmojiReactionSchema, ListIssueEmojiReactionsSchema, ListIssueNoteEmojiReactionsSchema, CreateMergeRequestNoteSchema, CreateMergeRequestDiscussionNoteSchema, CreateMergeRequestEmojiReactionSchema, CreateMergeRequestNoteEmojiReactionSchema, ListMergeRequestEmojiReactionsSchema, ListMergeRequestNoteEmojiReactionsSchema, CreateMergeRequestSchema, CreateMergeRequestThreadSchema, CreateNoteSchema, CreateCommitStatusSchema, CreateOrUpdateFileSchema, CreatePipelineSchema, CreateRepositorySchema, CreateGroupSchema, DeleteBranchSchema, GetProtectedBranchSchema, ListProtectedBranchesSchema, ProtectBranchSchema, UpdateProtectedBranchSchema, UnprotectBranchSchema, UpdateDefaultBranchSchema, DeleteDraftNoteSchema, DeleteIssueLinkSchema, DeleteIssueSchema, DeleteIssueEmojiReactionSchema, DeleteIssueNoteEmojiReactionSchema, DeleteMergeRequestNoteSchema, DeleteMergeRequestEmojiReactionSchema, DeleteMergeRequestNoteEmojiReactionSchema, ForkRepositorySchema, GetBranchDiffsSchema, GetBranchSchema, GetCommitDiffSchema, GetCommitSchema, GetFileBlameSchema, GitLabBlameEntrySchema, GetDraftNoteSchema, GetFileContentsSchema, GetIssueLinkSchema, GetIssueSchema, GetMergeRequestDiffsSchema, GetMergeRequestSchema, GetDeploymentSchema, CreateDeploymentSchema, UpdateDeploymentSchema, DeploymentApprovalSchema, ListDeploymentMergeRequestsSchema, GetEnvironmentSchema, UpdateEnvironmentSchema, StopEnvironmentSchema, StopStaleEnvironmentsSchema, DeleteReviewAppEnvironmentsSchema, PipelineTriggerIdSchema, ListPipelineTriggersSchema, CreatePipelineTriggerSchema, UpdatePipelineTriggerSchema, TriggerPipelineSchema, GetNamespaceSchema, GitLabCiLintResultSchema, GetPipelineJobOutputSchema, PipelineJobControlSchema, GetPipelineSchema, GetPipelineVariablesSchema, UpdatePipelineMetadataSchema, DeletePipelineSchema, PipelineReportSchema, WaitForPipelineSchema, WaitForPipelineJobSchema, PlayPipelineJobsSchema, GetProjectSchema, GetRepositoryTreeSchema, GetUsersSchema, GetUserSchema, GitLabUserFullSchema, WhoAmISchema, GitLabCurrentUserSchema, GitLabCommitSchema, GitLabCommitStatusSchema, GitLabCompareResultSchema, GitLabContentSchema, GitLabCreateUpdateFileResponseSchema, GitLabDiffSchema,
143
144
  // Discussion Schemas
144
145
  GitLabDiscussionNoteSchema, // Added
145
146
  GitLabDiscussionSchema,
146
147
  // Draft Notes Schemas
147
- GitLabDraftNoteSchema, GitLabForkSchema, GitLabBranchSchema, GitLabProtectedBranchSchema, GitLabProtectedTagSchema, GitLabGroupSchema, GitLabIssueLinkSchema, GitLabIssueSchema, GitLabIssueWithLinkDetailsSchema, GitLabMarkdownUploadSchema, GitLabMergeRequestPipelineSchema, GitLabMergeRequestSchema, GitLabMilestonesSchema, GitLabGroupMilestonesSchema, GitLabNamespaceExistsResponseSchema, GitLabNamespaceSchema, GitLabPipelineJobSchema, GitLabDeploymentSchema, GitLabEnvironmentSchema, GitLabPipelineSchema, GitLabPipelineScheduleSchema, GitLabPipelineScheduleVariableSchema, GitLabPipelineSchedulePlayResultSchema, ListPipelineSchedulesSchema, GetPipelineScheduleSchema, ListPipelineSchedulePipelinesSchema, CreatePipelineScheduleSchema, UpdatePipelineScheduleSchema, DeletePipelineScheduleSchema, PlayPipelineScheduleSchema, TakeOwnershipPipelineScheduleSchema, GetPipelineScheduleVariableSchema, CreatePipelineScheduleVariableSchema, UpdatePipelineScheduleVariableSchema, DeletePipelineScheduleVariableSchema, GitLabPipelineTriggerJobSchema, GitLabProjectMemberSchema, GitLabProjectSchema, GitLabTodoSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabSearchBlobResultSchema, GitLabSearchResponseSchema, GitLabTreeItemSchema, GitLabUserSchema, GitLabUsersResponseSchema, GroupIteration, ListCommitStatusesSchema, ListBranchesSchema, ListCommitsSchema, ListDraftNotesSchema, ListGroupIterationsSchema, GetGroupIterationSchema, UpdateGroupIterationSchema, CreateGroupIterationSchema, GroupIterationCadence, ListGroupIterationCadencesSchema, DeleteGroupIterationSchema, ListProjectIterationsSchema, CreateGroupIterationCadenceSchema, UpdateGroupIterationCadenceSchema, DeleteGroupIterationCadenceSchema, ListGroupProjectsSchema, GitLabCiVariableSchema, ListProjectVariablesSchema, GetProjectVariableSchema, CreateProjectVariableSchema, UpdateProjectVariableSchema, DeleteProjectVariableSchema, ListGroupVariablesSchema, GetGroupVariableSchema, CreateGroupVariableSchema, UpdateGroupVariableSchema, DeleteGroupVariableSchema, GitLabDependencyProxySchema, GitLabDependencyProxyBlobSchema, GetDependencyProxySettingsSchema, UpdateDependencyProxySettingsSchema, ListDependencyProxyBlobsSchema, PurgeDependencyProxyCacheSchema, ListProjectVulnerabilitiesSchema, GetVulnerabilitySchema, DismissVulnerabilitySchema, ConfirmVulnerabilitySchema, ListIssueDiscussionsSchema, ListIssueLinksSchema, ListIssuesSchema, ListTodosSchema, ListLabelsSchema, ListMergeRequestDiffsSchema, // Added
148
- GetMergeRequestFileDiffSchema, ListMergeRequestChangedFilesSchema, ListMergeRequestDiscussionsSchema, ListMergeRequestPipelinesSchema, ListMergeRequestsSchema, ListGroupMergeRequestsSchema, ListMergeRequestVersionsSchema, GetMergeRequestVersionSchema, GitLabMergeRequestVersionSchema, GitLabMergeRequestVersionDetailSchema, ListNamespacesSchema, ListPipelineJobsSchema, ListPipelinesSchema, ListDeploymentsSchema, ListEnvironmentsSchema, ListProjectRunnersSchema, GetRunnerSchema, ListPipelineTriggerJobsSchema, ValidateCiLintSchema, ValidateProjectCiLintSchema, ListCiCatalogResourcesSchema, GetCiCatalogResourceSchema, ListProjectMembersSchema, ListGroupMembersSchema, ListProjectMilestonesSchema, ListGroupMilestonesSchema, ListProjectsSchema, MarkdownUploadSchema, MarkdownUploadRemoteSchema, DownloadAttachmentSchema, DownloadJobArtifactsSchema, GetJobArtifactFileSchema, GitLabArtifactEntrySchema, ListJobArtifactsSchema, MergeMergeRequestSchema, ApproveMergeRequestSchema, UnapproveMergeRequestSchema, RebaseMergeRequestSchema, GetMergeRequestApprovalStateSchema, GetMergeRequestConflictsSchema, GitLabMergeRequestApprovalStateSchema, MyIssuesSchema, OrbitQuerySchema, OrbitSchemaSchema, OrbitStatusSchema, OrbitToolsSchema, MarkAllTodosDoneSchema, MarkTodoDoneSchema, PaginatedDiscussionsResponseSchema, PromoteProjectMilestoneSchema, PublishDraftNoteSchema, PlayPipelineJobSchema, PushFilesSchema, RetryPipelineJobSchema, RetryPipelineSchema, SearchCodeSchema, SearchGroupCodeSchema, SearchProjectCodeSchema, SearchRepositoriesSchema, UpdateDraftNoteSchema, UpdateIssueNoteSchema, UpdateIssueSchema, UpdateIssueDescriptionPatchSchema, ReorderIssueSchema, UpdateLabelSchema, UpdateProjectSchema, UpdateMergeRequestNoteSchema, UpdateMergeRequestDiscussionNoteSchema, UpdateMergeRequestSchema, VerifyNamespaceSchema, GitLabEventSchema, ListEventsSchema, GetProjectEventsSchema, ExecuteGraphQLSchema, GitLabReleaseSchema, ListReleasesSchema, GetReleaseSchema, CreateReleaseSchema, UpdateReleaseSchema, DeleteReleaseSchema, CreateReleaseEvidenceSchema, DownloadReleaseAssetSchema, ListTagsSchema, GetTagSchema, CreateTagSchema, DeleteTagSchema, GetTagSignatureSchema, ListProtectedTagsSchema, GetProtectedTagSchema, ProtectTagSchema, UnprotectTagSchema, GitLabTagSchema, GitLabTagSignatureSchema, ListSnippetsSchema, GetSnippetSchema, CreateSnippetSchema, UpdateSnippetSchema, DeleteSnippetSchema, GitLabSnippetSchema, GetMergeRequestNotesSchema, GetMergeRequestNoteSchema, GetMergeRequestDiscussionSchema, DeleteMergeRequestDiscussionNoteSchema, ResolveMergeRequestThreadSchema, GetWorkItemSchema, ListWorkItemsSchema, CreateWorkItemSchema, UpdateWorkItemSchema, ConvertWorkItemTypeSchema, ListWorkItemStatusesSchema, ListWorkItemNotesSchema, CreateWorkItemNoteSchema, CreateWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, ListWorkItemEmojiReactionsSchema, ListWorkItemNoteEmojiReactionsSchema, DeleteWorkItemEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema, MoveWorkItemSchema, ListCustomFieldDefinitionsSchema, GetTimelineEventsSchema, CreateTimelineEventSchema, ListWebhooksSchema, CreateWebhookSchema, UpdateWebhookSchema, DeleteWebhookSchema, ListWebhookEventsSchema, GetWebhookEventSchema, HealthCheckSchema, } from "./schemas.js";
148
+ GitLabDraftNoteSchema, GitLabForkSchema, GitLabBranchSchema, GitLabProtectedBranchSchema, GitLabProtectedTagSchema, GitLabGroupSchema, GitLabIssueLinkSchema, GitLabIssueSchema, GitLabIssueWithLinkDetailsSchema, GitLabMarkdownUploadSchema, GitLabMergeRequestPipelineSchema, GitLabMergeRequestSchema, GitLabNamespaceExistsResponseSchema, GitLabNamespaceSchema, GitLabPipelineJobSchema, GitLabDeploymentSchema, GitLabEnvironmentSchema, GitLabPipelineSchema, GitLabPipelineScheduleSchema, GitLabPipelineScheduleVariableSchema, GitLabPipelineSchedulePlayResultSchema, ListPipelineSchedulesSchema, GetPipelineScheduleSchema, ListPipelineSchedulePipelinesSchema, CreatePipelineScheduleSchema, UpdatePipelineScheduleSchema, DeletePipelineScheduleSchema, PlayPipelineScheduleSchema, TakeOwnershipPipelineScheduleSchema, GetPipelineScheduleVariableSchema, CreatePipelineScheduleVariableSchema, UpdatePipelineScheduleVariableSchema, DeletePipelineScheduleVariableSchema, GitLabPipelineTriggerJobSchema, GitLabProjectMemberSchema, GitLabProjectSchema, GitLabTodoSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabSearchBlobResultSchema, GitLabSearchResponseSchema, GitLabTreeItemSchema, GitLabUserSchema, GitLabUsersResponseSchema, GroupIteration, ListCommitStatusesSchema, ListBranchesSchema, ListCommitsSchema, ListDraftNotesSchema, ListGroupIterationsSchema, GetGroupIterationSchema, UpdateGroupIterationSchema, CreateGroupIterationSchema, GroupIterationCadence, ListGroupIterationCadencesSchema, DeleteGroupIterationSchema, ListProjectIterationsSchema, CreateGroupIterationCadenceSchema, UpdateGroupIterationCadenceSchema, DeleteGroupIterationCadenceSchema, ListGroupProjectsSchema, GitLabCiVariableSchema, ListProjectVariablesSchema, GetProjectVariableSchema, CreateProjectVariableSchema, UpdateProjectVariableSchema, DeleteProjectVariableSchema, ListGroupVariablesSchema, GetGroupVariableSchema, CreateGroupVariableSchema, UpdateGroupVariableSchema, DeleteGroupVariableSchema, GitLabDependencyProxySchema, GitLabDependencyProxyBlobSchema, GetDependencyProxySettingsSchema, UpdateDependencyProxySettingsSchema, ListDependencyProxyBlobsSchema, PurgeDependencyProxyCacheSchema, ListProjectVulnerabilitiesSchema, GetVulnerabilitySchema, DismissVulnerabilitySchema, ConfirmVulnerabilitySchema, ListIssueDiscussionsSchema, ListIssueLinksSchema, ListIssuesSchema, ListTodosSchema, ListMergeRequestDiffsSchema, // Added
149
+ GetMergeRequestFileDiffSchema, ListMergeRequestChangedFilesSchema, ListMergeRequestDiscussionsSchema, ListMergeRequestPipelinesSchema, ListMergeRequestsSchema, ListGroupMergeRequestsSchema, ListMergeRequestVersionsSchema, GetMergeRequestVersionSchema, GitLabMergeRequestVersionSchema, GitLabMergeRequestVersionDetailSchema, ListNamespacesSchema, ListPipelineJobsSchema, ListPipelinesSchema, ListDeploymentsSchema, ListEnvironmentsSchema, ListProjectRunnersSchema, GetRunnerSchema, ListPipelineTriggerJobsSchema, ValidateCiLintSchema, ValidateProjectCiLintSchema, ListCiCatalogResourcesSchema, GetCiCatalogResourceSchema, ListProjectMembersSchema, ListGroupMembersSchema, ListProjectsSchema, MarkdownUploadSchema, MarkdownUploadRemoteSchema, DownloadAttachmentSchema, DownloadJobArtifactsSchema, GetJobArtifactFileSchema, GitLabArtifactEntrySchema, ListJobArtifactsSchema, MergeMergeRequestSchema, ApproveMergeRequestSchema, UnapproveMergeRequestSchema, RebaseMergeRequestSchema, GetMergeRequestApprovalStateSchema, GetMergeRequestConflictsSchema, GitLabMergeRequestApprovalStateSchema, MyIssuesSchema, OrbitQuerySchema, OrbitSchemaSchema, OrbitStatusSchema, OrbitToolsSchema, MarkAllTodosDoneSchema, MarkTodoDoneSchema, PaginatedDiscussionsResponseSchema, PublishDraftNoteSchema, PlayPipelineJobSchema, PushFilesSchema, RetryPipelineJobSchema, RetryPipelineSchema, SearchCodeSchema, SearchGroupCodeSchema, SearchProjectCodeSchema, SearchRepositoriesSchema, UpdateDraftNoteSchema, UpdateIssueNoteSchema, UpdateIssueSchema, UpdateIssueDescriptionPatchSchema, ReorderIssueSchema, UpdateProjectSchema, UpdateMergeRequestNoteSchema, UpdateMergeRequestDiscussionNoteSchema, UpdateMergeRequestSchema, VerifyNamespaceSchema, GitLabEventSchema, ListEventsSchema, GetProjectEventsSchema, ExecuteGraphQLSchema, GitLabReleaseSchema, ListReleasesSchema, GetReleaseSchema, CreateReleaseSchema, UpdateReleaseSchema, DeleteReleaseSchema, CreateReleaseEvidenceSchema, DownloadReleaseAssetSchema, ListTagsSchema, GetTagSchema, CreateTagSchema, DeleteTagSchema, GetTagSignatureSchema, ListProtectedTagsSchema, GetProtectedTagSchema, ProtectTagSchema, UnprotectTagSchema, GitLabTagSchema, GitLabTagSignatureSchema, ListSnippetsSchema, GetSnippetSchema, CreateSnippetSchema, UpdateSnippetSchema, DeleteSnippetSchema, GitLabSnippetSchema, GetMergeRequestNotesSchema, GetMergeRequestNoteSchema, GetMergeRequestDiscussionSchema, DeleteMergeRequestDiscussionNoteSchema, ResolveMergeRequestThreadSchema, GetWorkItemSchema, ListWorkItemsSchema, CreateWorkItemSchema, UpdateWorkItemSchema, ConvertWorkItemTypeSchema, ListWorkItemStatusesSchema, ListWorkItemNotesSchema, CreateWorkItemNoteSchema, CreateWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, ListWorkItemEmojiReactionsSchema, ListWorkItemNoteEmojiReactionsSchema, DeleteWorkItemEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema, MoveWorkItemSchema, ListCustomFieldDefinitionsSchema, GetTimelineEventsSchema, CreateTimelineEventSchema, ListWebhooksSchema, CreateWebhookSchema, UpdateWebhookSchema, DeleteWebhookSchema, ListWebhookEventsSchema, GetWebhookEventSchema, HealthCheckSchema, } from "./schemas.js";
149
150
  import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
150
151
  import { createLogger, flushBufferedLogs, flushStartupLogs } from "./utils/logger.js";
151
152
  const logger = createLogger();
@@ -988,14 +989,25 @@ configureGitLabRequestContext({
988
989
  getDispatcherForUrl: apiUrl => clientPool.getDispatcherForUrl(apiUrl),
989
990
  getOAuthAccessToken: () => OAUTH_ACCESS_TOKEN,
990
991
  });
991
- // The wiki handlers call back into the fetch, error handling, and project scope
992
- // helpers below; fetch is read at call time because the cookie reload replaces it.
992
+ // The wiki, milestone, and label handlers call back into the fetch, error handling, and project
993
+ // scope helpers below; fetch is read at call time because the cookie reload replaces it.
993
994
  configureWikiTools({
994
995
  getFetch: () => fetch,
995
996
  handleGitLabError,
996
997
  getEffectiveProjectId,
997
998
  rejectIfStrictProjectScope,
998
999
  });
1000
+ configureMilestoneTools({
1001
+ getFetch: () => fetch,
1002
+ handleGitLabError,
1003
+ getEffectiveProjectId,
1004
+ rejectIfStrictProjectScope,
1005
+ });
1006
+ configureLabelTools({
1007
+ getFetch: () => fetch,
1008
+ handleGitLabError,
1009
+ getEffectiveProjectId,
1010
+ });
999
1011
  // Create cookie jar with clean Netscape file parsing
1000
1012
  // Resolve cookie path once using os.homedir() for cross-platform support
1001
1013
  const resolvedCookiePath = GITLAB_AUTH_COOKIE_PATH
@@ -4939,113 +4951,6 @@ async function listProjects(options = {}) {
4939
4951
  const data = await response.json();
4940
4952
  return filterProjectsByAllowlist(z.array(GitLabProjectSchema).parse(data));
4941
4953
  }
4942
- /**
4943
- * List labels for a project
4944
- *
4945
- * @param projectId The ID or URL-encoded path of the project
4946
- * @param options Optional parameters for listing labels
4947
- * @returns Array of GitLab labels
4948
- */
4949
- async function listLabels(projectId, options = {}) {
4950
- projectId = decodeURIComponent(projectId); // Decode project ID
4951
- // Construct the URL with project path
4952
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/labels`);
4953
- // Add query parameters
4954
- appendFilterParams(url.searchParams, options);
4955
- // Make the API request
4956
- const response = await fetch(url.toString(), {
4957
- ...getFetchConfig(),
4958
- });
4959
- // Handle errors
4960
- await handleGitLabError(response);
4961
- // Parse and return the data
4962
- const data = await response.json();
4963
- return data;
4964
- }
4965
- /**
4966
- * Get a single label from a project
4967
- *
4968
- * @param projectId The ID or URL-encoded path of the project
4969
- * @param labelId The ID or name of the label
4970
- * @param includeAncestorGroups Whether to include ancestor groups
4971
- * @returns GitLab label
4972
- */
4973
- async function getLabel(projectId, labelId, includeAncestorGroups) {
4974
- projectId = decodeURIComponent(projectId); // Decode project ID
4975
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/labels/${encodeGitLabPathSegment(String(labelId))}`);
4976
- // Add query parameters
4977
- if (includeAncestorGroups !== undefined) {
4978
- url.searchParams.append("include_ancestor_groups", includeAncestorGroups ? "true" : "false");
4979
- }
4980
- // Make the API request
4981
- const response = await fetch(url.toString(), {
4982
- ...getFetchConfig(),
4983
- });
4984
- // Handle errors
4985
- await handleGitLabError(response);
4986
- // Parse and return the data
4987
- const data = await response.json();
4988
- return data;
4989
- }
4990
- /**
4991
- * Create a new label in a project
4992
- *
4993
- * @param projectId The ID or URL-encoded path of the project
4994
- * @param options Options for creating the label
4995
- * @returns Created GitLab label
4996
- */
4997
- async function createLabel(projectId, options) {
4998
- projectId = decodeURIComponent(projectId); // Decode project ID
4999
- // Make the API request
5000
- const response = await fetch(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/labels`, {
5001
- ...getFetchConfig(),
5002
- method: "POST",
5003
- body: JSON.stringify(options),
5004
- });
5005
- // Handle errors
5006
- await handleGitLabError(response);
5007
- // Parse and return the data
5008
- const data = await response.json();
5009
- return data;
5010
- }
5011
- /**
5012
- * Update an existing label in a project
5013
- *
5014
- * @param projectId The ID or URL-encoded path of the project
5015
- * @param labelId The ID or name of the label to update
5016
- * @param options Options for updating the label
5017
- * @returns Updated GitLab label
5018
- */
5019
- async function updateLabel(projectId, labelId, options) {
5020
- projectId = decodeURIComponent(projectId); // Decode project ID
5021
- // Make the API request
5022
- const response = await fetch(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/labels/${encodeGitLabPathSegment(String(labelId))}`, {
5023
- ...getFetchConfig(),
5024
- method: "PUT",
5025
- body: JSON.stringify(options),
5026
- });
5027
- // Handle errors
5028
- await handleGitLabError(response);
5029
- // Parse and return the data
5030
- const data = await response.json();
5031
- return data;
5032
- }
5033
- /**
5034
- * Delete a label from a project
5035
- *
5036
- * @param projectId The ID or URL-encoded path of the project
5037
- * @param labelId The ID or name of the label to delete
5038
- */
5039
- async function deleteLabel(projectId, labelId) {
5040
- projectId = decodeURIComponent(projectId); // Decode project ID
5041
- // Make the API request
5042
- const response = await fetch(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/labels/${encodeGitLabPathSegment(String(labelId))}`, {
5043
- ...getFetchConfig(),
5044
- method: "DELETE",
5045
- });
5046
- // Handle errors
5047
- await handleGitLabError(response);
5048
- }
5049
4954
  /**
5050
4955
  * List all projects in a GitLab group
5051
4956
  *
@@ -6257,298 +6162,6 @@ async function getRepositoryTree(options) {
6257
6162
  const next_page = response.headers.get("x-next-page") || undefined;
6258
6163
  return { items, next_page_token, next_page };
6259
6164
  }
6260
- /**
6261
- * List project milestones in a GitLab project
6262
- * @param {string} projectId - The ID or URL-encoded path of the project
6263
- * @param {Object} options - Options for listing milestones
6264
- * @returns {Promise<GitLabMilestones[]>} List of milestones
6265
- */
6266
- async function listProjectMilestones(projectId, options) {
6267
- projectId = decodeURIComponent(projectId);
6268
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones`);
6269
- Object.entries(options).forEach(([key, value]) => {
6270
- // Drop blank entries inside arrays so they behave like the scalar blank guard below
6271
- const normalized = dropBlankArrayEntries(value);
6272
- if (isBlankFilterValue(normalized)) {
6273
- return;
6274
- }
6275
- if (key === "iids" && Array.isArray(normalized)) {
6276
- normalized.forEach(iid => {
6277
- url.searchParams.append("iids[]", String(iid));
6278
- });
6279
- }
6280
- else {
6281
- url.searchParams.append(key, String(normalized));
6282
- }
6283
- });
6284
- const response = await fetch(url.toString(), {
6285
- ...getFetchConfig(),
6286
- });
6287
- await handleGitLabError(response);
6288
- const data = await response.json();
6289
- return z.array(GitLabMilestonesSchema).parse(data);
6290
- }
6291
- /**
6292
- * Get a single milestone in a GitLab project
6293
- * @param {string} projectId - The ID or URL-encoded path of the project
6294
- * @param {number} milestoneId - The ID of the milestone
6295
- * @returns {Promise<GitLabMilestones>} Milestone details
6296
- */
6297
- async function getProjectMilestone(projectId, milestoneId) {
6298
- projectId = decodeURIComponent(projectId);
6299
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}`);
6300
- const response = await fetch(url.toString(), {
6301
- ...getFetchConfig(),
6302
- });
6303
- await handleGitLabError(response);
6304
- const data = await response.json();
6305
- return GitLabMilestonesSchema.parse(data);
6306
- }
6307
- /**
6308
- * Create a new milestone in a GitLab project
6309
- * @param {string} projectId - The ID or URL-encoded path of the project
6310
- * @param {Object} options - Options for creating a milestone
6311
- * @returns {Promise<GitLabMilestones>} Created milestone
6312
- */
6313
- async function createProjectMilestone(projectId, options) {
6314
- projectId = decodeURIComponent(projectId);
6315
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones`);
6316
- const response = await fetch(url.toString(), {
6317
- ...getFetchConfig(),
6318
- method: "POST",
6319
- body: JSON.stringify(options),
6320
- });
6321
- await handleGitLabError(response);
6322
- const data = await response.json();
6323
- return GitLabMilestonesSchema.parse(data);
6324
- }
6325
- /**
6326
- * Edit an existing milestone in a GitLab project
6327
- * @param {string} projectId - The ID or URL-encoded path of the project
6328
- * @param {number} milestoneId - The ID of the milestone
6329
- * @param {Object} options - Options for editing a milestone
6330
- * @returns {Promise<GitLabMilestones>} Updated milestone
6331
- */
6332
- async function editProjectMilestone(projectId, milestoneId, options) {
6333
- projectId = decodeURIComponent(projectId);
6334
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}`);
6335
- const response = await fetch(url.toString(), {
6336
- ...getFetchConfig(),
6337
- method: "PUT",
6338
- body: JSON.stringify(options),
6339
- });
6340
- await handleGitLabError(response);
6341
- const data = await response.json();
6342
- return GitLabMilestonesSchema.parse(data);
6343
- }
6344
- /**
6345
- * Delete a milestone from a GitLab project
6346
- * @param {string} projectId - The ID or URL-encoded path of the project
6347
- * @param {number} milestoneId - The ID of the milestone
6348
- * @returns {Promise<void>}
6349
- */
6350
- async function deleteProjectMilestone(projectId, milestoneId) {
6351
- projectId = decodeURIComponent(projectId);
6352
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}`);
6353
- const response = await fetch(url.toString(), {
6354
- ...getFetchConfig(),
6355
- method: "DELETE",
6356
- });
6357
- await handleGitLabError(response);
6358
- }
6359
- /**
6360
- * Get all issues assigned to a single milestone
6361
- * @param {string} projectId - The ID or URL-encoded path of the project
6362
- * @param {number} milestoneId - The ID of the milestone
6363
- * @returns {Promise<GitLabIssue[]>} List of issues
6364
- */
6365
- async function getMilestoneIssues(projectId, milestoneId, options = {}) {
6366
- projectId = decodeURIComponent(projectId);
6367
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}/issues`);
6368
- appendFilterParams(url.searchParams, options);
6369
- const response = await fetch(url.toString(), {
6370
- ...getFetchConfig(),
6371
- });
6372
- await handleGitLabError(response);
6373
- const data = await response.json();
6374
- return z.array(GitLabIssueSchema).parse(data);
6375
- }
6376
- /**
6377
- * Get all merge requests assigned to a single milestone
6378
- * @param {string} projectId - The ID or URL-encoded path of the project
6379
- * @param {number} milestoneId - The ID of the milestone
6380
- * @returns {Promise<GitLabMergeRequest[]>} List of merge requests
6381
- */
6382
- async function getMilestoneMergeRequests(projectId, milestoneId, options = {}) {
6383
- projectId = decodeURIComponent(projectId);
6384
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}/merge_requests`);
6385
- appendFilterParams(url.searchParams, options);
6386
- const response = await fetch(url.toString(), {
6387
- ...getFetchConfig(),
6388
- });
6389
- await handleGitLabError(response);
6390
- const data = await response.json();
6391
- return z.array(GitLabMergeRequestSchema).parse(data);
6392
- }
6393
- /**
6394
- * Promote a project milestone to a group milestone
6395
- * @param {string} projectId - The ID or URL-encoded path of the project
6396
- * @param {number} milestoneId - The ID of the milestone
6397
- * @returns {Promise<GitLabGroupMilestones>} Promoted milestone
6398
- */
6399
- async function promoteProjectMilestone(projectId, milestoneId) {
6400
- projectId = decodeURIComponent(projectId);
6401
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}/promote`);
6402
- const response = await fetch(url.toString(), {
6403
- ...getFetchConfig(),
6404
- method: "POST",
6405
- });
6406
- await handleGitLabError(response);
6407
- const data = await response.json();
6408
- return GitLabGroupMilestonesSchema.parse(data);
6409
- }
6410
- /**
6411
- * Get all burndown chart events for a single milestone
6412
- * @param {string} projectId - The ID or URL-encoded path of the project
6413
- * @param {number} milestoneId - The ID of the milestone
6414
- * @returns {Promise<any[]>} Burndown chart events
6415
- */
6416
- async function getMilestoneBurndownEvents(projectId, milestoneId, options = {}) {
6417
- projectId = decodeURIComponent(projectId);
6418
- const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/milestones/${encodeGitLabPathSegment(milestoneId)}/burndown_events`);
6419
- appendFilterParams(url.searchParams, options);
6420
- const response = await fetch(url.toString(), {
6421
- ...getFetchConfig(),
6422
- });
6423
- await handleGitLabError(response);
6424
- const data = await response.json();
6425
- return data;
6426
- }
6427
- /**
6428
- * List milestones in a GitLab group
6429
- */
6430
- async function listGroupMilestones(groupId, options) {
6431
- groupId = decodeURIComponent(groupId);
6432
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones`);
6433
- Object.entries(options).forEach(([key, value]) => {
6434
- // Drop blank entries inside arrays so they behave like the scalar blank guard below
6435
- const normalized = dropBlankArrayEntries(value);
6436
- if (isBlankFilterValue(normalized)) {
6437
- return;
6438
- }
6439
- if (key === "iids" && Array.isArray(normalized)) {
6440
- normalized.forEach(iid => {
6441
- url.searchParams.append("iids[]", String(iid));
6442
- });
6443
- }
6444
- else {
6445
- url.searchParams.append(key, String(normalized));
6446
- }
6447
- });
6448
- const response = await fetch(url.toString(), {
6449
- ...getFetchConfig(),
6450
- });
6451
- await handleGitLabError(response);
6452
- const data = await response.json();
6453
- return z.array(GitLabGroupMilestonesSchema).parse(data);
6454
- }
6455
- /**
6456
- * Get a single milestone in a GitLab group
6457
- */
6458
- async function getGroupMilestone(groupId, milestoneId) {
6459
- groupId = decodeURIComponent(groupId);
6460
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones/${encodeGitLabPathSegment(milestoneId)}`);
6461
- const response = await fetch(url.toString(), {
6462
- ...getFetchConfig(),
6463
- });
6464
- await handleGitLabError(response);
6465
- const data = await response.json();
6466
- return GitLabGroupMilestonesSchema.parse(data);
6467
- }
6468
- /**
6469
- * Create a new milestone in a GitLab group
6470
- */
6471
- async function createGroupMilestone(groupId, options) {
6472
- groupId = decodeURIComponent(groupId);
6473
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones`);
6474
- const response = await fetch(url.toString(), {
6475
- ...getFetchConfig(),
6476
- method: "POST",
6477
- body: JSON.stringify(options),
6478
- });
6479
- await handleGitLabError(response);
6480
- const data = await response.json();
6481
- return GitLabGroupMilestonesSchema.parse(data);
6482
- }
6483
- /**
6484
- * Edit an existing milestone in a GitLab group
6485
- */
6486
- async function editGroupMilestone(groupId, milestoneId, options) {
6487
- groupId = decodeURIComponent(groupId);
6488
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones/${encodeGitLabPathSegment(milestoneId)}`);
6489
- const response = await fetch(url.toString(), {
6490
- ...getFetchConfig(),
6491
- method: "PUT",
6492
- body: JSON.stringify(options),
6493
- });
6494
- await handleGitLabError(response);
6495
- const data = await response.json();
6496
- return GitLabGroupMilestonesSchema.parse(data);
6497
- }
6498
- /**
6499
- * Delete a milestone from a GitLab group
6500
- */
6501
- async function deleteGroupMilestone(groupId, milestoneId) {
6502
- groupId = decodeURIComponent(groupId);
6503
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones/${encodeGitLabPathSegment(milestoneId)}`);
6504
- const response = await fetch(url.toString(), {
6505
- ...getFetchConfig(),
6506
- method: "DELETE",
6507
- });
6508
- await handleGitLabError(response);
6509
- }
6510
- /**
6511
- * Get all issues assigned to a single group milestone
6512
- */
6513
- async function getGroupMilestoneIssues(groupId, milestoneId, options = {}) {
6514
- groupId = decodeURIComponent(groupId);
6515
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones/${encodeGitLabPathSegment(milestoneId)}/issues`);
6516
- appendFilterParams(url.searchParams, options);
6517
- const response = await fetch(url.toString(), {
6518
- ...getFetchConfig(),
6519
- });
6520
- await handleGitLabError(response);
6521
- const data = await response.json();
6522
- return z.array(GitLabIssueSchema).parse(data);
6523
- }
6524
- /**
6525
- * Get all merge requests assigned to a single group milestone
6526
- */
6527
- async function getGroupMilestoneMergeRequests(groupId, milestoneId, options = {}) {
6528
- groupId = decodeURIComponent(groupId);
6529
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones/${encodeGitLabPathSegment(milestoneId)}/merge_requests`);
6530
- appendFilterParams(url.searchParams, options);
6531
- const response = await fetch(url.toString(), {
6532
- ...getFetchConfig(),
6533
- });
6534
- await handleGitLabError(response);
6535
- const data = await response.json();
6536
- return z.array(GitLabMergeRequestSchema).parse(data);
6537
- }
6538
- /**
6539
- * Get burndown chart events for a group milestone
6540
- */
6541
- async function getGroupMilestoneBurndownEvents(groupId, milestoneId, options = {}) {
6542
- groupId = decodeURIComponent(groupId);
6543
- const url = new URL(`${getEffectiveApiUrl()}/groups/${encodeGitLabPathSegment(groupId)}/milestones/${encodeGitLabPathSegment(milestoneId)}/burndown_events`);
6544
- appendFilterParams(url.searchParams, options);
6545
- const response = await fetch(url.toString(), {
6546
- ...getFetchConfig(),
6547
- });
6548
- await handleGitLabError(response);
6549
- const data = await response.json();
6550
- return data;
6551
- }
6552
6165
  /**
6553
6166
  * Get a single user from GitLab
6554
6167
  *
@@ -9517,47 +9130,12 @@ async function handleToolCall(params) {
9517
9130
  content: [{ type: "text", text: JSON.stringify(result) }],
9518
9131
  };
9519
9132
  }
9520
- case "list_labels": {
9521
- const { project_id, ...options } = ListLabelsSchema.parse(params.arguments);
9522
- const labels = await listLabels(project_id, options);
9523
- return {
9524
- content: [{ type: "text", text: JSON.stringify(labels) }],
9525
- };
9526
- }
9527
- case "get_label": {
9528
- const args = GetLabelSchema.parse(params.arguments);
9529
- const label = await getLabel(args.project_id, args.label_id, args.include_ancestor_groups);
9530
- return {
9531
- content: [{ type: "text", text: JSON.stringify(label) }],
9532
- };
9533
- }
9534
- case "create_label": {
9535
- const args = CreateLabelSchema.parse(params.arguments);
9536
- const label = await createLabel(args.project_id, args);
9537
- return {
9538
- content: [{ type: "text", text: JSON.stringify(label) }],
9539
- };
9540
- }
9541
- case "update_label": {
9542
- const args = UpdateLabelSchema.parse(params.arguments);
9543
- const { project_id, label_id, ...options } = args;
9544
- const label = await updateLabel(project_id, label_id, options);
9545
- return {
9546
- content: [{ type: "text", text: JSON.stringify(label) }],
9547
- };
9548
- }
9549
- case "delete_label": {
9550
- const args = DeleteLabelSchema.parse(params.arguments);
9551
- await deleteLabel(args.project_id, args.label_id);
9552
- return {
9553
- content: [
9554
- {
9555
- type: "text",
9556
- text: JSON.stringify({ status: "success", message: "Label deleted successfully" }),
9557
- },
9558
- ],
9559
- };
9560
- }
9133
+ case "list_labels":
9134
+ case "get_label":
9135
+ case "create_label":
9136
+ case "update_label":
9137
+ case "delete_label":
9138
+ return await handleLabelToolCall(params);
9561
9139
  case "list_group_projects": {
9562
9140
  const args = ListGroupProjectsSchema.parse(params.arguments);
9563
9141
  const projects = await listGroupProjects(args);
@@ -10393,224 +9971,24 @@ async function handleToolCall(params) {
10393
9971
  content: [{ type: "text", text: JSON.stringify(mergeRequests) }],
10394
9972
  };
10395
9973
  }
10396
- case "list_milestones": {
10397
- const { project_id, ...options } = ListProjectMilestonesSchema.parse(params.arguments);
10398
- const milestones = await listProjectMilestones(project_id, options);
10399
- return {
10400
- content: [
10401
- {
10402
- type: "text",
10403
- text: JSON.stringify(milestones),
10404
- },
10405
- ],
10406
- };
10407
- }
10408
- case "get_milestone": {
10409
- const { project_id, milestone_id } = GetProjectMilestoneSchema.parse(params.arguments);
10410
- const milestone = await getProjectMilestone(project_id, milestone_id);
10411
- return {
10412
- content: [
10413
- {
10414
- type: "text",
10415
- text: JSON.stringify(milestone),
10416
- },
10417
- ],
10418
- };
10419
- }
10420
- case "create_milestone": {
10421
- const { project_id, ...options } = CreateProjectMilestoneSchema.parse(params.arguments);
10422
- const milestone = await createProjectMilestone(project_id, options);
10423
- return {
10424
- content: [
10425
- {
10426
- type: "text",
10427
- text: JSON.stringify(milestone),
10428
- },
10429
- ],
10430
- };
10431
- }
10432
- case "edit_milestone": {
10433
- const { project_id, milestone_id, ...options } = EditProjectMilestoneSchema.parse(params.arguments);
10434
- const milestone = await editProjectMilestone(project_id, milestone_id, options);
10435
- return {
10436
- content: [
10437
- {
10438
- type: "text",
10439
- text: JSON.stringify(milestone),
10440
- },
10441
- ],
10442
- };
10443
- }
10444
- case "delete_milestone": {
10445
- const { project_id, milestone_id } = DeleteProjectMilestoneSchema.parse(params.arguments);
10446
- await deleteProjectMilestone(project_id, milestone_id);
10447
- return {
10448
- content: [
10449
- {
10450
- type: "text",
10451
- text: JSON.stringify({
10452
- status: "success",
10453
- message: "Milestone deleted successfully",
10454
- }),
10455
- },
10456
- ],
10457
- };
10458
- }
10459
- case "get_milestone_issue": {
10460
- const { project_id, milestone_id, ...options } = GetMilestoneIssuesSchema.parse(params.arguments);
10461
- const issues = await getMilestoneIssues(project_id, milestone_id, options);
10462
- return {
10463
- content: [
10464
- {
10465
- type: "text",
10466
- text: JSON.stringify(issues),
10467
- },
10468
- ],
10469
- };
10470
- }
10471
- case "get_milestone_merge_requests": {
10472
- const { project_id, milestone_id, ...options } = GetMilestoneMergeRequestsSchema.parse(params.arguments);
10473
- const mergeRequests = await getMilestoneMergeRequests(project_id, milestone_id, options);
10474
- return {
10475
- content: [
10476
- {
10477
- type: "text",
10478
- text: JSON.stringify(mergeRequests),
10479
- },
10480
- ],
10481
- };
10482
- }
10483
- case "promote_milestone": {
10484
- const { project_id, milestone_id } = PromoteProjectMilestoneSchema.parse(params.arguments);
10485
- const milestone = await promoteProjectMilestone(project_id, milestone_id);
10486
- return {
10487
- content: [
10488
- {
10489
- type: "text",
10490
- text: JSON.stringify(milestone),
10491
- },
10492
- ],
10493
- };
10494
- }
10495
- case "get_milestone_burndown_events": {
10496
- const { project_id, milestone_id, ...options } = GetMilestoneBurndownEventsSchema.parse(params.arguments);
10497
- const events = await getMilestoneBurndownEvents(project_id, milestone_id, options);
10498
- return {
10499
- content: [
10500
- {
10501
- type: "text",
10502
- text: JSON.stringify(events),
10503
- },
10504
- ],
10505
- };
10506
- }
10507
- case "list_group_milestones": {
10508
- rejectIfStrictProjectScope("list_group_milestones");
10509
- const { group_id, ...options } = ListGroupMilestonesSchema.parse(params.arguments);
10510
- const milestones = await listGroupMilestones(group_id, options);
10511
- return {
10512
- content: [
10513
- {
10514
- type: "text",
10515
- text: JSON.stringify(milestones),
10516
- },
10517
- ],
10518
- };
10519
- }
10520
- case "get_group_milestone": {
10521
- rejectIfStrictProjectScope("get_group_milestone");
10522
- const { group_id, milestone_id } = GetGroupMilestoneSchema.parse(params.arguments);
10523
- const milestone = await getGroupMilestone(group_id, milestone_id);
10524
- return {
10525
- content: [
10526
- {
10527
- type: "text",
10528
- text: JSON.stringify(milestone),
10529
- },
10530
- ],
10531
- };
10532
- }
10533
- case "create_group_milestone": {
10534
- rejectIfStrictProjectScope("create_group_milestone");
10535
- const { group_id, ...options } = CreateGroupMilestoneSchema.parse(params.arguments);
10536
- const milestone = await createGroupMilestone(group_id, options);
10537
- return {
10538
- content: [
10539
- {
10540
- type: "text",
10541
- text: JSON.stringify(milestone),
10542
- },
10543
- ],
10544
- };
10545
- }
10546
- case "edit_group_milestone": {
10547
- rejectIfStrictProjectScope("edit_group_milestone");
10548
- const { group_id, milestone_id, ...options } = EditGroupMilestoneSchema.parse(params.arguments);
10549
- const milestone = await editGroupMilestone(group_id, milestone_id, options);
10550
- return {
10551
- content: [
10552
- {
10553
- type: "text",
10554
- text: JSON.stringify(milestone),
10555
- },
10556
- ],
10557
- };
10558
- }
10559
- case "delete_group_milestone": {
10560
- rejectIfStrictProjectScope("delete_group_milestone");
10561
- const { group_id, milestone_id } = DeleteGroupMilestoneSchema.parse(params.arguments);
10562
- await deleteGroupMilestone(group_id, milestone_id);
10563
- return {
10564
- content: [
10565
- {
10566
- type: "text",
10567
- text: JSON.stringify({
10568
- status: "success",
10569
- message: "Group milestone deleted successfully",
10570
- }),
10571
- },
10572
- ],
10573
- };
10574
- }
10575
- case "get_group_milestone_issue": {
10576
- rejectIfStrictProjectScope("get_group_milestone_issue");
10577
- const { group_id, milestone_id, ...options } = GetGroupMilestoneIssuesSchema.parse(params.arguments);
10578
- const issues = await getGroupMilestoneIssues(group_id, milestone_id, options);
10579
- return {
10580
- content: [
10581
- {
10582
- type: "text",
10583
- text: JSON.stringify(issues),
10584
- },
10585
- ],
10586
- };
10587
- }
10588
- case "get_group_milestone_merge_requests": {
10589
- rejectIfStrictProjectScope("get_group_milestone_merge_requests");
10590
- const { group_id, milestone_id, ...options } = GetGroupMilestoneMergeRequestsSchema.parse(params.arguments);
10591
- const mergeRequests = await getGroupMilestoneMergeRequests(group_id, milestone_id, options);
10592
- return {
10593
- content: [
10594
- {
10595
- type: "text",
10596
- text: JSON.stringify(mergeRequests),
10597
- },
10598
- ],
10599
- };
10600
- }
10601
- case "get_group_milestone_burndown_events": {
10602
- rejectIfStrictProjectScope("get_group_milestone_burndown_events");
10603
- const { group_id, milestone_id, ...options } = GetGroupMilestoneBurndownEventsSchema.parse(params.arguments);
10604
- const events = await getGroupMilestoneBurndownEvents(group_id, milestone_id, options);
10605
- return {
10606
- content: [
10607
- {
10608
- type: "text",
10609
- text: JSON.stringify(events),
10610
- },
10611
- ],
10612
- };
10613
- }
9974
+ case "list_milestones":
9975
+ case "get_milestone":
9976
+ case "create_milestone":
9977
+ case "edit_milestone":
9978
+ case "delete_milestone":
9979
+ case "get_milestone_issue":
9980
+ case "get_milestone_merge_requests":
9981
+ case "promote_milestone":
9982
+ case "get_milestone_burndown_events":
9983
+ case "list_group_milestones":
9984
+ case "get_group_milestone":
9985
+ case "create_group_milestone":
9986
+ case "edit_group_milestone":
9987
+ case "delete_group_milestone":
9988
+ case "get_group_milestone_issue":
9989
+ case "get_group_milestone_merge_requests":
9990
+ case "get_group_milestone_burndown_events":
9991
+ return await handleMilestoneToolCall(params);
10614
9992
  case "list_commits": {
10615
9993
  const args = ListCommitsSchema.parse(params.arguments);
10616
9994
  const commits = await listCommits(args.project_id, args);