@zereight/mcp-gitlab 2.0.4 → 2.0.6

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/schemas.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { flexibleBoolean, flexibleBooleanNullable } from "./customSchemas.js";
2
+ import { flexibleBoolean } from "./customSchemas.js";
3
3
  // Base schemas for common types
4
4
  export const GitLabAuthorSchema = z.object({
5
5
  name: z.string(),
@@ -36,7 +36,7 @@ export const GitLabPipelineSchema = z.object({
36
36
  label: z.string().optional(),
37
37
  group: z.string().optional(),
38
38
  tooltip: z.string().optional(),
39
- has_details: flexibleBoolean.optional(),
39
+ has_details: z.boolean().optional(),
40
40
  details_path: z.string().optional(),
41
41
  illustration: z
42
42
  .object({
@@ -57,7 +57,7 @@ export const GitLabPipelineJobSchema = z.object({
57
57
  stage: z.string(),
58
58
  name: z.string(),
59
59
  ref: z.string(),
60
- tag: flexibleBoolean,
60
+ tag: z.boolean(),
61
61
  coverage: z.coerce.number().nullable().optional(),
62
62
  created_at: z.string(),
63
63
  started_at: z.string().nullable().optional(),
@@ -98,7 +98,7 @@ export const GitLabPipelineTriggerJobSchema = z.object({
98
98
  stage: z.string(),
99
99
  name: z.string(),
100
100
  ref: z.string(),
101
- tag: flexibleBoolean,
101
+ tag: z.boolean(),
102
102
  coverage: z.number().nullable().optional(),
103
103
  created_at: z.string(),
104
104
  started_at: z.string().nullable().optional(),
@@ -135,13 +135,13 @@ export const GitLabPipelineTriggerJobSchema = z.object({
135
135
  })
136
136
  .optional(),
137
137
  web_url: z.string().optional(),
138
- allow_failure: flexibleBoolean.optional(),
139
- archived: flexibleBoolean.optional(),
138
+ allow_failure: z.boolean().optional(),
139
+ archived: z.boolean().optional(),
140
140
  source: z.string().optional(),
141
141
  erased_at: z.string().nullable().optional(),
142
142
  project: z
143
143
  .object({
144
- ci_job_token_scope_enabled: flexibleBoolean.optional(),
144
+ ci_job_token_scope_enabled: z.boolean().optional(),
145
145
  })
146
146
  .optional(),
147
147
  downstream_pipeline: z
@@ -189,7 +189,7 @@ export const ListPipelinesSchema = z
189
189
  .describe("The status of pipelines"),
190
190
  ref: z.string().optional().describe("The ref of pipelines"),
191
191
  sha: z.string().optional().describe("The SHA of pipelines"),
192
- yaml_errors: flexibleBoolean
192
+ yaml_errors: z.boolean()
193
193
  .optional()
194
194
  .describe("Returns pipelines with invalid configurations"),
195
195
  username: z.string().optional().describe("The username of the user who triggered pipelines"),
@@ -222,7 +222,7 @@ export const ListPipelineJobsSchema = z
222
222
  .enum(["created", "pending", "running", "failed", "success", "canceled", "skipped", "manual"])
223
223
  .optional()
224
224
  .describe("The scope of jobs to show"),
225
- include_retried: flexibleBoolean.optional().describe("Whether to include retried jobs"),
225
+ include_retried: z.boolean().optional().describe("Whether to include retried jobs"),
226
226
  })
227
227
  .merge(PaginationOptionsSchema);
228
228
  // Schema for listing trigger jobs (bridges) in a pipeline
@@ -282,6 +282,31 @@ export const GetPipelineJobOutputSchema = z.object({
282
282
  .optional()
283
283
  .describe("Number of lines to skip from the end of the log (default: 0)"),
284
284
  });
285
+ // Schema for pipeline job control operations
286
+ export const PipelineJobControlSchema = z.object({
287
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
288
+ job_id: z.coerce.string().describe("The ID of the job"),
289
+ });
290
+ // Schema for running a manual job
291
+ export const PlayPipelineJobSchema = z.object({
292
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
293
+ job_id: z.coerce.string().describe("The ID of the job"),
294
+ job_variables_attributes: z
295
+ .array(z.object({
296
+ key: z.string().describe("Variable key"),
297
+ value: z.string().describe("Variable value"),
298
+ }))
299
+ .optional()
300
+ .describe("Custom job variables to use when running the job"),
301
+ });
302
+ // Schema for retrying a job
303
+ export const RetryPipelineJobSchema = PipelineJobControlSchema;
304
+ // Schema for canceling a job
305
+ export const CancelPipelineJobSchema = z.object({
306
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
307
+ job_id: z.coerce.string().describe("The ID of the job"),
308
+ force: z.boolean().optional().describe("Force cancellation of the job"),
309
+ });
285
310
  // User schemas
286
311
  export const GitLabUserSchema = z.object({
287
312
  username: z.string().optional(), // Changed from login to match GitLab API
@@ -323,12 +348,12 @@ export const GitLabNamespaceSchema = z.object({
323
348
  plan: z.string().optional(),
324
349
  end_date: z.string().nullable().optional(),
325
350
  trial_ends_on: z.string().nullable().optional(),
326
- trial: flexibleBoolean.optional(),
351
+ trial: z.boolean().optional(),
327
352
  root_repository_size: z.number().optional(),
328
353
  projects_count: z.number().optional(),
329
354
  });
330
355
  export const GitLabNamespaceExistsResponseSchema = z.object({
331
- exists: flexibleBoolean,
356
+ exists: z.boolean(),
332
357
  suggests: z.array(z.string()).optional(),
333
358
  });
334
359
  // Repository related schemas
@@ -348,7 +373,7 @@ export const GitLabRepositorySchema = z.object({
348
373
  owner: GitLabOwnerSchema.optional(),
349
374
  web_url: z.string().optional(),
350
375
  description: z.string().nullable(),
351
- fork: flexibleBoolean.optional(),
376
+ fork: z.boolean().optional(),
352
377
  ssh_url_to_repo: z.string().optional(),
353
378
  http_url_to_repo: z.string().optional(),
354
379
  created_at: z.string().optional(),
@@ -369,7 +394,7 @@ export const GitLabRepositorySchema = z.object({
369
394
  topics: z.array(z.string()).optional(),
370
395
  tag_list: z.array(z.string()).optional(), // deprecated but still present
371
396
  open_issues_count: z.number().optional(),
372
- archived: flexibleBoolean.optional(),
397
+ archived: z.boolean().optional(),
373
398
  forks_count: z.number().optional(),
374
399
  star_count: z.number().optional(),
375
400
  permissions: z
@@ -390,17 +415,17 @@ export const GitLabRepositorySchema = z.object({
390
415
  .nullable(),
391
416
  })
392
417
  .optional(),
393
- container_registry_enabled: flexibleBoolean.optional(),
418
+ container_registry_enabled: z.boolean().optional(),
394
419
  container_registry_access_level: z.string().optional(),
395
- issues_enabled: flexibleBoolean.optional(),
396
- merge_requests_enabled: flexibleBoolean.optional(),
420
+ issues_enabled: z.boolean().optional(),
421
+ merge_requests_enabled: z.boolean().optional(),
397
422
  merge_requests_template: z.string().nullable().optional(),
398
- wiki_enabled: flexibleBoolean.optional(),
399
- jobs_enabled: flexibleBoolean.optional(),
400
- snippets_enabled: flexibleBoolean.optional(),
401
- can_create_merge_request_in: flexibleBoolean.optional(),
402
- resolve_outdated_diff_discussions: flexibleBooleanNullable.optional(),
403
- shared_runners_enabled: flexibleBoolean.optional(),
423
+ wiki_enabled: z.boolean().optional(),
424
+ jobs_enabled: z.boolean().optional(),
425
+ snippets_enabled: z.boolean().optional(),
426
+ can_create_merge_request_in: z.boolean().optional(),
427
+ resolve_outdated_diff_discussions: z.boolean().nullable().optional(),
428
+ shared_runners_enabled: z.boolean().optional(),
404
429
  shared_with_groups: z
405
430
  .array(z.object({
406
431
  group_id: z.coerce.string(),
@@ -424,7 +449,7 @@ export const GitLabFileContentSchema = z.object({
424
449
  blob_id: z.string(), // Added to match GitLab API
425
450
  commit_id: z.string(), // ID of the current file version
426
451
  last_commit_id: z.string(), // Added to match GitLab API
427
- execute_filemode: flexibleBoolean.optional(), // Added to match GitLab API
452
+ execute_filemode: z.boolean().optional(), // Added to match GitLab API
428
453
  });
429
454
  export const GitLabDirectoryContentSchema = z.object({
430
455
  name: z.string(),
@@ -458,7 +483,7 @@ export const GetRepositoryTreeSchema = z.object({
458
483
  .string()
459
484
  .optional()
460
485
  .describe("The name of a repository branch or tag. Defaults to the default branch."),
461
- recursive: flexibleBoolean.optional().describe("Boolean value to get a recursive tree"),
486
+ recursive: z.boolean().optional().describe("Boolean value to get a recursive tree"),
462
487
  per_page: z.number().optional().describe("Number of results to show per page"),
463
488
  page_token: z.string().optional().describe("The tree record ID for pagination"),
464
489
  pagination: z.string().optional().describe("Pagination method (keyset)"),
@@ -511,7 +536,7 @@ export const GitLabMilestonesSchema = z.object({
511
536
  state: z.string(),
512
537
  updated_at: z.string(),
513
538
  created_at: z.string(),
514
- expired: flexibleBoolean,
539
+ expired: z.boolean(),
515
540
  web_url: z.string().optional(),
516
541
  });
517
542
  // Input schemas for operations
@@ -519,7 +544,7 @@ export const CreateRepositoryOptionsSchema = z.object({
519
544
  name: z.string(),
520
545
  description: z.string().optional(),
521
546
  visibility: z.enum(["private", "internal", "public"]).optional(), // Changed from private to match GitLab API
522
- initialize_with_readme: flexibleBoolean.optional(), // Changed from auto_init to match GitLab API
547
+ initialize_with_readme: z.boolean().optional(), // Changed from auto_init to match GitLab API
523
548
  });
524
549
  export const CreateIssueOptionsSchema = z.object({
525
550
  title: z.string(),
@@ -534,9 +559,9 @@ export const GitLabDiffSchema = z.object({
534
559
  a_mode: z.string(),
535
560
  b_mode: z.string(),
536
561
  diff: z.string(),
537
- new_file: flexibleBoolean,
538
- renamed_file: flexibleBoolean,
539
- deleted_file: flexibleBoolean,
562
+ new_file: z.boolean(),
563
+ renamed_file: z.boolean(),
564
+ deleted_file: z.boolean(),
540
565
  });
541
566
  // Response schemas for operations
542
567
  export const GitLabCreateUpdateFileResponseSchema = z.object({
@@ -569,8 +594,8 @@ export const GitLabCompareResultSchema = z.object({
569
594
  .optional(),
570
595
  commits: z.array(GitLabCommitSchema),
571
596
  diffs: z.array(GitLabDiffSchema),
572
- compare_timeout: flexibleBoolean.optional(),
573
- compare_same_ref: flexibleBoolean.optional(),
597
+ compare_timeout: z.boolean().optional(),
598
+ compare_same_ref: z.boolean().optional(),
574
599
  });
575
600
  // Issue related schemas
576
601
  export const GitLabLabelSchema = z.object({
@@ -583,9 +608,9 @@ export const GitLabLabelSchema = z.object({
583
608
  open_issues_count: z.number().optional(),
584
609
  closed_issues_count: z.number().optional(),
585
610
  open_merge_requests_count: z.number().optional(),
586
- subscribed: flexibleBoolean.optional(),
611
+ subscribed: z.boolean().optional(),
587
612
  priority: z.number().nullable().optional(),
588
- is_project_label: flexibleBoolean.optional(),
613
+ is_project_label: z.boolean().optional(),
589
614
  });
590
615
  export const GitLabMilestoneSchema = z.object({
591
616
  id: z.coerce.string(),
@@ -625,9 +650,9 @@ export const GitLabIssueSchema = z.object({
625
650
  human_total_time_spent: z.string().nullable(),
626
651
  })
627
652
  .optional(),
628
- confidential: flexibleBoolean.optional(),
653
+ confidential: z.boolean().optional(),
629
654
  due_date: z.string().nullable().optional(),
630
- discussion_locked: flexibleBooleanNullable.optional(),
655
+ discussion_locked: z.boolean().nullable().optional(),
631
656
  weight: z.number().nullable().optional(),
632
657
  issue_type: z.string().describe("the type of issue.").nullish(),
633
658
  });
@@ -667,8 +692,8 @@ export const GitLabMergeRequestSchema = z.object({
667
692
  title: z.string(),
668
693
  description: z.string().nullable(),
669
694
  state: z.string(),
670
- merged: flexibleBoolean.optional(),
671
- draft: flexibleBoolean.optional(),
695
+ merged: z.boolean().optional(),
696
+ draft: z.boolean().optional(),
672
697
  author: GitLabUserSchema,
673
698
  assignees: z.array(GitLabUserSchema).optional(),
674
699
  reviewers: z.array(GitLabUserSchema).optional(),
@@ -684,15 +709,15 @@ export const GitLabMergeRequestSchema = z.object({
684
709
  detailed_merge_status: z.string().optional(),
685
710
  merge_status: z.string().optional(),
686
711
  merge_error: z.string().nullable().optional(),
687
- work_in_progress: flexibleBoolean.optional(),
688
- blocking_discussions_resolved: flexibleBoolean.optional(),
689
- should_remove_source_branch: flexibleBooleanNullable.optional(),
690
- force_remove_source_branch: flexibleBooleanNullable.optional(),
691
- allow_collaboration: flexibleBoolean.optional(),
692
- allow_maintainer_to_push: flexibleBoolean.optional(),
712
+ work_in_progress: z.boolean().optional(),
713
+ blocking_discussions_resolved: z.boolean().optional(),
714
+ should_remove_source_branch: z.boolean().nullable().optional(),
715
+ force_remove_source_branch: z.boolean().nullable().optional(),
716
+ allow_collaboration: z.boolean().optional(),
717
+ allow_maintainer_to_push: z.boolean().optional(),
693
718
  changes_count: z.string().nullable().optional(),
694
- merge_when_pipeline_succeeds: flexibleBoolean.optional(),
695
- squash: flexibleBoolean.optional(),
719
+ merge_when_pipeline_succeeds: z.boolean().optional(),
720
+ squash: z.boolean().optional(),
696
721
  labels: z.array(z.string()).optional(),
697
722
  });
698
723
  export const LineRangeSchema = z
@@ -705,7 +730,7 @@ export const LineRangeSchema = z
705
730
  .optional()
706
731
  .describe("CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_10_15'. Get this from GitLab diff API response, never fabricate."),
707
732
  type: z
708
- .enum(["new", "old", "expanded"])
733
+ .enum(["new", "old", "expanded", "logic", "style"])
709
734
  .nullable()
710
735
  .optional()
711
736
  .describe("Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. MUST match the line_code format and old_line/new_line values."),
@@ -729,7 +754,7 @@ export const LineRangeSchema = z
729
754
  .optional()
730
755
  .describe("CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_12_17'. Must be from same file as start.line_code."),
731
756
  type: z
732
- .enum(["new", "old", "expanded"])
757
+ .enum(["new", "old", "expanded", "logic", "style"])
733
758
  .nullable()
734
759
  .optional()
735
760
  .describe("Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. SHOULD MATCH start.type for consistent ranges (don't mix old/new types)."),
@@ -756,13 +781,13 @@ export const GitLabDiscussionNoteSchema = z.object({
756
781
  author: GitLabUserSchema.optional(),
757
782
  created_at: z.string().optional(),
758
783
  updated_at: z.string().optional(),
759
- system: flexibleBoolean.optional(),
784
+ system: z.boolean().optional(),
760
785
  noteable_id: z.coerce.string().optional(),
761
786
  noteable_type: z.enum(["Issue", "MergeRequest", "Snippet", "Commit", "Epic"]).optional(),
762
787
  project_id: z.coerce.string().optional(),
763
788
  noteable_iid: z.coerce.string().nullable().optional(),
764
- resolvable: flexibleBoolean.optional(),
765
- resolved: flexibleBoolean.optional(),
789
+ resolvable: z.boolean().optional(),
790
+ resolved: z.boolean().optional(),
766
791
  resolved_by: GitLabUserSchema.nullable().optional(),
767
792
  resolved_at: z.string().nullable().optional(),
768
793
  position: z
@@ -810,7 +835,7 @@ export const PaginatedResponseSchema = z.object({
810
835
  });
811
836
  export const GitLabDiscussionSchema = z.object({
812
837
  id: z.coerce.string(),
813
- individual_note: flexibleBoolean,
838
+ individual_note: z.boolean(),
814
839
  notes: z.array(GitLabDiscussionNoteSchema),
815
840
  });
816
841
  // Create a schema for paginated discussions response
@@ -834,7 +859,7 @@ export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
834
859
  discussion_id: z.coerce.string().describe("The ID of a thread"),
835
860
  note_id: z.coerce.string().describe("The ID of a thread note"),
836
861
  body: z.string().optional().describe("The content of the note or reply"),
837
- resolved: flexibleBoolean.optional().describe("Resolve or unresolve the note"),
862
+ resolved: z.boolean().optional().describe("Resolve or unresolve the note"),
838
863
  })
839
864
  .refine(data => data.body !== undefined || data.resolved !== undefined, {
840
865
  message: "At least one of 'body' or 'resolved' must be provided",
@@ -885,7 +910,7 @@ export const CreateRepositorySchema = z.object({
885
910
  .enum(["private", "internal", "public"])
886
911
  .optional()
887
912
  .describe("Repository visibility level"),
888
- initialize_with_readme: flexibleBoolean.optional().describe("Initialize with README.md"),
913
+ initialize_with_readme: z.boolean().optional().describe("Initialize with README.md"),
889
914
  });
890
915
  export const GetFileContentsSchema = ProjectParamsSchema.extend({
891
916
  file_path: z.string().describe("Path to the file or directory"),
@@ -921,12 +946,12 @@ const MergeRequestOptionsSchema = {
921
946
  .optional()
922
947
  .describe("The ID of the users to assign as reviewers of the MR"),
923
948
  labels: z.array(z.string()).optional().describe("Labels for the MR"),
924
- draft: flexibleBoolean.optional().describe("Create as draft merge request"),
949
+ draft: z.boolean().optional().describe("Create as draft merge request"),
925
950
  allow_collaboration: z.boolean().optional().describe("Allow commits from upstream members"),
926
- remove_source_branch: flexibleBooleanNullable
951
+ remove_source_branch: z.boolean().nullable()
927
952
  .optional()
928
953
  .describe("Flag indicating if a merge request should remove the source branch when merging."),
929
- squash: flexibleBooleanNullable
954
+ squash: z.boolean().nullable()
930
955
  .optional()
931
956
  .describe("If true, squash all commits into a single commit on merge."),
932
957
  };
@@ -943,7 +968,7 @@ export const CreateBranchSchema = ProjectParamsSchema.extend({
943
968
  export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
944
969
  from: z.string().describe("The base branch or commit SHA to compare from"),
945
970
  to: z.string().describe("The target branch or commit SHA to compare to"),
946
- straight: flexibleBoolean
971
+ straight: z.boolean()
947
972
  .optional()
948
973
  .describe("Comparison method: false for '...' (default), true for '--'"),
949
974
  excluded_file_patterns: z
@@ -973,17 +998,17 @@ export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
973
998
  .boolean()
974
999
  .optional()
975
1000
  .describe("Flag indicating if the source branch should be removed"),
976
- squash: flexibleBoolean.optional().describe("Squash commits into a single commit when merging"),
977
- draft: flexibleBoolean.optional().describe("Work in progress merge request"),
1001
+ squash: z.boolean().optional().describe("Squash commits into a single commit when merging"),
1002
+ draft: z.boolean().optional().describe("Work in progress merge request"),
978
1003
  });
979
1004
  export const MergeMergeRequestSchema = ProjectParamsSchema.extend({
980
1005
  merge_request_iid: z.coerce.string().optional().describe("The IID of a merge request"),
981
- auto_merge: flexibleBoolean.optional().default(false).describe("If true, the merge request merges when the pipeline succeeds."),
1006
+ auto_merge: z.boolean().optional().default(false).describe("If true, the merge request merges when the pipeline succeeds."),
982
1007
  merge_commit_message: z.string().optional().describe("Custom merge commit message"),
983
- merge_when_pipeline_succeeds: flexibleBoolean.optional().default(false).describe("If true, the merge request merges when the pipeline succeeds.in GitLab 17.11. Use"),
984
- should_remove_source_branch: flexibleBoolean.optional().default(false).describe("Remove source branch after merge"),
1008
+ merge_when_pipeline_succeeds: z.boolean().optional().default(false).describe("If true, the merge request merges when the pipeline succeeds.in GitLab 17.11. Use"),
1009
+ should_remove_source_branch: z.boolean().optional().default(false).describe("Remove source branch after merge"),
985
1010
  squash_commit_message: z.string().optional().describe("Custom squash commit message"),
986
- squash: flexibleBoolean.optional().default(false).describe("Squash commits into a single commit when merging"),
1011
+ squash: z.boolean().optional().default(false).describe("Squash commits into a single commit when merging"),
987
1012
  });
988
1013
  export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
989
1014
  view: z.enum(["inline", "parallel"]).optional().describe("Diff view type"),
@@ -991,7 +1016,7 @@ export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
991
1016
  export const ListMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
992
1017
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
993
1018
  per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
994
- unidiff: flexibleBoolean
1019
+ unidiff: z.boolean()
995
1020
  .optional()
996
1021
  .describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
997
1022
  });
@@ -1020,21 +1045,19 @@ export const ListIssuesSchema = z
1020
1045
  .describe("Return issues assigned to the given username"),
1021
1046
  author_id: z.coerce.string().optional().describe("Return issues created by the given user ID"),
1022
1047
  author_username: z.string().optional().describe("Return issues created by the given username"),
1023
- confidential: flexibleBoolean.optional().describe("Filter confidential or public issues"),
1048
+ confidential: z.boolean().optional().describe("Filter confidential or public issues"),
1024
1049
  created_after: z.string().optional().describe("Return issues created after the given time"),
1025
1050
  created_before: z.string().optional().describe("Return issues created before the given time"),
1026
1051
  due_date: z.string().optional().describe("Return issues that have the due date"),
1027
1052
  labels: z.array(z.string()).optional().describe("Array of label names"),
1028
1053
  milestone: z.string().optional().describe("Milestone title"),
1029
1054
  issue_type: z
1030
- .string()
1055
+ .enum(["issue", "incident", "test_case", "task"])
1031
1056
  .optional()
1032
- .nullable()
1033
1057
  .describe("Filter to a given type of issue. One of issue, incident, test_case or task"),
1034
1058
  iteration_id: z.coerce
1035
1059
  .string()
1036
1060
  .optional()
1037
- .nullable()
1038
1061
  .describe("Return issues assigned to the given iteration ID. None returns issues that do not belong to an iteration. Any returns issues that belong to an iteration. "),
1039
1062
  scope: z
1040
1063
  .enum(["created_by_me", "assigned_to_me", "all"])
@@ -1047,7 +1070,7 @@ export const ListIssuesSchema = z
1047
1070
  .describe("Return issues with a specific state"),
1048
1071
  updated_after: z.string().optional().describe("Return issues updated after the given time"),
1049
1072
  updated_before: z.string().optional().describe("Return issues updated before the given time"),
1050
- with_labels_details: flexibleBoolean.optional().describe("Return more details for each label"),
1073
+ with_labels_details: z.boolean().optional().describe("Return more details for each label"),
1051
1074
  })
1052
1075
  .merge(PaginationOptionsSchema);
1053
1076
  // Merge Requests API operation schemas
@@ -1132,7 +1155,7 @@ export const ListMergeRequestsSchema = z
1132
1155
  .enum(["yes", "no"])
1133
1156
  .optional()
1134
1157
  .describe("Filter merge requests against their wip status"),
1135
- with_labels_details: flexibleBoolean.optional().describe("Return more details for each label"),
1158
+ with_labels_details: z.boolean().optional().describe("Return more details for each label"),
1136
1159
  })
1137
1160
  .merge(PaginationOptionsSchema);
1138
1161
  export const GetIssueSchema = z.object({
@@ -1145,8 +1168,8 @@ export const UpdateIssueSchema = z.object({
1145
1168
  title: z.string().optional().describe("The title of the issue"),
1146
1169
  description: z.string().optional().describe("The description of the issue"),
1147
1170
  assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign issue to"),
1148
- confidential: flexibleBoolean.optional().describe("Set the issue to be confidential"),
1149
- discussion_locked: flexibleBoolean.optional().describe("Flag to lock discussions"),
1171
+ confidential: z.boolean().optional().describe("Set the issue to be confidential"),
1172
+ discussion_locked: z.boolean().optional().describe("Flag to lock discussions"),
1150
1173
  due_date: z.string().optional().describe("Date the issue is due (YYYY-MM-DD)"),
1151
1174
  labels: z.array(z.string()).optional().describe("Array of label names"),
1152
1175
  milestone_id: z.coerce.string().optional().describe("Milestone ID to assign"),
@@ -1192,7 +1215,7 @@ export const DeleteIssueLinkSchema = z.object({
1192
1215
  export const ListNamespacesSchema = z
1193
1216
  .object({
1194
1217
  search: z.string().optional().describe("Search term for namespaces"),
1195
- owned: flexibleBoolean.optional().describe("Filter for namespaces owned by current user"),
1218
+ owned: z.boolean().optional().describe("Filter for namespaces owned by current user"),
1196
1219
  })
1197
1220
  .merge(PaginationOptionsSchema);
1198
1221
  export const GetNamespaceSchema = z.object({
@@ -1208,15 +1231,15 @@ export const GetProjectSchema = z.object({
1208
1231
  export const ListProjectsSchema = z
1209
1232
  .object({
1210
1233
  search: z.string().optional().describe("Search term for projects"),
1211
- search_namespaces: flexibleBoolean
1234
+ search_namespaces: z.boolean()
1212
1235
  .optional()
1213
1236
  .describe("Needs to be true if search is full path"),
1214
- owned: flexibleBoolean.optional().describe("Filter for projects owned by current user"),
1215
- membership: flexibleBoolean
1237
+ owned: z.boolean().optional().describe("Filter for projects owned by current user"),
1238
+ membership: z.boolean()
1216
1239
  .optional()
1217
1240
  .describe("Filter for projects where current user is a member"),
1218
- simple: flexibleBoolean.optional().describe("Return only limited fields"),
1219
- archived: flexibleBoolean.optional().describe("Filter for archived projects"),
1241
+ simple: z.boolean().optional().describe("Return only limited fields"),
1242
+ archived: z.boolean().optional().describe("Filter for archived projects"),
1220
1243
  visibility: z
1221
1244
  .enum(["public", "internal", "private"])
1222
1245
  .optional()
@@ -1247,13 +1270,13 @@ export const ListLabelsSchema = z.object({
1247
1270
  .boolean()
1248
1271
  .optional()
1249
1272
  .describe("Whether or not to include issue and merge request counts"),
1250
- include_ancestor_groups: flexibleBoolean.optional().describe("Include ancestor groups"),
1273
+ include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
1251
1274
  search: z.string().optional().describe("Keyword to filter labels by"),
1252
1275
  });
1253
1276
  export const GetLabelSchema = z.object({
1254
1277
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1255
1278
  label_id: z.coerce.string().describe("The ID or title of a project's label"),
1256
- include_ancestor_groups: flexibleBoolean.optional().describe("Include ancestor groups"),
1279
+ include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
1257
1280
  });
1258
1281
  export const CreateLabelSchema = z.object({
1259
1282
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
@@ -1283,14 +1306,14 @@ export const DeleteLabelSchema = z.object({
1283
1306
  export const ListGroupProjectsSchema = z
1284
1307
  .object({
1285
1308
  group_id: z.coerce.string().describe("Group ID or path"),
1286
- include_subgroups: flexibleBoolean.optional().describe("Include projects from subgroups"),
1309
+ include_subgroups: z.boolean().optional().describe("Include projects from subgroups"),
1287
1310
  search: z.string().optional().describe("Search term to filter projects"),
1288
1311
  order_by: z
1289
1312
  .enum(["name", "path", "created_at", "updated_at", "last_activity_at"])
1290
1313
  .optional()
1291
1314
  .describe("Field to sort by"),
1292
1315
  sort: z.enum(["asc", "desc"]).optional().describe("Sort direction"),
1293
- archived: flexibleBoolean.optional().describe("Filter for archived projects"),
1316
+ archived: z.boolean().optional().describe("Filter for archived projects"),
1294
1317
  visibility: z
1295
1318
  .enum(["public", "internal", "private"])
1296
1319
  .optional()
@@ -1305,17 +1328,17 @@ export const ListGroupProjectsSchema = z
1305
1328
  .describe("Filter projects with merge requests feature enabled"),
1306
1329
  min_access_level: z.number().optional().describe("Filter by minimum access level"),
1307
1330
  with_programming_language: z.string().optional().describe("Filter by programming language"),
1308
- starred: flexibleBoolean.optional().describe("Filter by starred projects"),
1309
- statistics: flexibleBoolean.optional().describe("Include project statistics"),
1310
- with_custom_attributes: flexibleBoolean.optional().describe("Include custom attributes"),
1311
- with_security_reports: flexibleBoolean.optional().describe("Include security reports"),
1331
+ starred: z.boolean().optional().describe("Filter by starred projects"),
1332
+ statistics: z.boolean().optional().describe("Include project statistics"),
1333
+ with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
1334
+ with_security_reports: z.boolean().optional().describe("Include security reports"),
1312
1335
  })
1313
1336
  .merge(PaginationOptionsSchema);
1314
1337
  // Add wiki operation schemas
1315
1338
  export const ListWikiPagesSchema = z
1316
1339
  .object({
1317
1340
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1318
- with_content: flexibleBoolean.optional().describe("Include content of the wiki pages"),
1341
+ with_content: z.boolean().optional().describe("Include content of the wiki pages"),
1319
1342
  })
1320
1343
  .merge(PaginationOptionsSchema);
1321
1344
  export const GetWikiPageSchema = z.object({
@@ -1426,7 +1449,7 @@ export const GitLabDraftNoteSchema = z.object({
1426
1449
  created_at: z.string().optional(),
1427
1450
  updated_at: z.string().optional(),
1428
1451
  position: MergeRequestThreadPositionSchema.nullable().optional(),
1429
- resolve_discussion: flexibleBoolean.optional(),
1452
+ resolve_discussion: z.boolean().optional(),
1430
1453
  }).transform((data) => ({
1431
1454
  // Normalize the response to always have consistent field names
1432
1455
  id: data.id,
@@ -1451,7 +1474,7 @@ export const CreateDraftNoteSchema = ProjectParamsSchema.extend({
1451
1474
  merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
1452
1475
  body: z.string().describe("The content of the draft note"),
1453
1476
  position: MergeRequestThreadPositionCreateSchema.optional().describe("Position when creating a diff note"),
1454
- resolve_discussion: flexibleBoolean.optional().describe("Whether to resolve the discussion when publishing"),
1477
+ resolve_discussion: z.boolean().optional().describe("Whether to resolve the discussion when publishing"),
1455
1478
  });
1456
1479
  // Update draft note schema
1457
1480
  export const UpdateDraftNoteSchema = ProjectParamsSchema.extend({
@@ -1459,7 +1482,7 @@ export const UpdateDraftNoteSchema = ProjectParamsSchema.extend({
1459
1482
  draft_note_id: z.coerce.string().describe("The ID of the draft note"),
1460
1483
  body: z.string().optional().describe("The content of the draft note"),
1461
1484
  position: MergeRequestThreadPositionCreateSchema.optional().describe("Position when creating a diff note"),
1462
- resolve_discussion: flexibleBoolean.optional().describe("Whether to resolve the discussion when publishing"),
1485
+ resolve_discussion: z.boolean().optional().describe("Whether to resolve the discussion when publishing"),
1463
1486
  });
1464
1487
  // Delete draft note schema
1465
1488
  export const DeleteDraftNoteSchema = ProjectParamsSchema.extend({
@@ -1498,7 +1521,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
1498
1521
  .string()
1499
1522
  .optional()
1500
1523
  .describe("Return only milestones with a title or description matching the provided string"),
1501
- include_ancestors: flexibleBoolean.optional().describe("Include ancestor groups"),
1524
+ include_ancestors: z.boolean().optional().describe("Include ancestor groups"),
1502
1525
  updated_before: z
1503
1526
  .string()
1504
1527
  .optional()
@@ -1557,26 +1580,27 @@ export const ListCommitsSchema = z.object({
1557
1580
  .describe("Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
1558
1581
  path: z.string().optional().describe("The file path"),
1559
1582
  author: z.string().optional().describe("Search commits by commit author"),
1560
- all: flexibleBoolean.optional().describe("Retrieve every commit from the repository"),
1561
- with_stats: flexibleBoolean
1583
+ all: z.boolean().optional().describe("Retrieve every commit from the repository"),
1584
+ with_stats: z.boolean()
1562
1585
  .optional()
1563
1586
  .describe("Stats about each commit are added to the response"),
1564
- first_parent: flexibleBoolean
1587
+ first_parent: z.boolean()
1565
1588
  .optional()
1566
1589
  .describe("Follow only the first parent commit upon seeing a merge commit"),
1567
1590
  order: z.enum(["default", "topo"]).optional().describe("List commits in order"),
1568
- trailers: flexibleBoolean.optional().describe("Parse and include Git trailers for every commit"),
1591
+ trailers: z.boolean().optional().describe("Parse and include Git trailers for every commit"),
1569
1592
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
1570
1593
  per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
1571
1594
  });
1572
1595
  export const GetCommitSchema = z.object({
1573
1596
  project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
1574
1597
  sha: z.string().describe("The commit hash or name of a repository branch or tag"),
1575
- stats: flexibleBoolean.optional().describe("Include commit stats"),
1598
+ stats: z.boolean().optional().describe("Include commit stats"),
1576
1599
  });
1577
1600
  export const GetCommitDiffSchema = z.object({
1578
1601
  project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
1579
1602
  sha: z.string().describe("The commit hash or name of a repository branch or tag"),
1603
+ full_diff: flexibleBoolean.optional().describe("Whether to return the full diff or only first page (default: false)"),
1580
1604
  });
1581
1605
  // Schema for listing issues assigned to the current user
1582
1606
  export const MyIssuesSchema = z.object({
@@ -1661,14 +1685,14 @@ export const ListGroupIterationsSchema = z
1661
1685
  .string()
1662
1686
  .optional()
1663
1687
  .describe("Return only iterations with a title matching the provided string."),
1664
- in: z
1688
+ search_in: z
1665
1689
  .array(z.enum(["title", "cadence_title"]))
1666
1690
  .optional()
1667
1691
  .describe("Fields in which fuzzy search should be performed with the query given in the argument search. The available options are title and cadence_title. Default is [title]."),
1668
- include_ancestors: flexibleBoolean
1692
+ include_ancestors: z.boolean()
1669
1693
  .optional()
1670
1694
  .describe("Include iterations for group and its ancestors. Defaults to true."),
1671
- include_descendants: flexibleBoolean
1695
+ include_descendants: z.boolean()
1672
1696
  .optional()
1673
1697
  .describe("Include iterations for group and its descendants. Defaults to false."),
1674
1698
  updated_before: z
@@ -1681,3 +1705,49 @@ export const ListGroupIterationsSchema = z
1681
1705
  .describe("Return only iterations updated after the given datetime. Expected in ISO 8601 format (2019-03-15T08:00:00Z)."),
1682
1706
  })
1683
1707
  .merge(PaginationOptionsSchema);
1708
+ // Events API schemas
1709
+ export const GitLabEventAuthorSchema = z.object({
1710
+ id: z.coerce.string(),
1711
+ name: z.string(),
1712
+ username: z.string(),
1713
+ state: z.string(),
1714
+ avatar_url: z.string().nullable(),
1715
+ web_url: z.string(),
1716
+ });
1717
+ export const GitLabEventSchema = z.object({
1718
+ id: z.coerce.string(),
1719
+ project_id: z.coerce.string(),
1720
+ action_name: z.string(),
1721
+ target_id: z.coerce.string().nullable(),
1722
+ target_iid: z.coerce.string().nullable(),
1723
+ target_type: z.string().nullable(),
1724
+ author_id: z.coerce.string(),
1725
+ target_title: z.string().nullable(),
1726
+ created_at: z.string(),
1727
+ author: GitLabEventAuthorSchema,
1728
+ author_username: z.string(),
1729
+ imported: z.boolean(),
1730
+ imported_from: z.string(),
1731
+ }).passthrough(); // Allow additional fields
1732
+ // List events schema
1733
+ export const ListEventsSchema = z.object({
1734
+ action: z.string().optional().describe("If defined, returns events with the specified action type"),
1735
+ target_type: z.enum(["epic", "issue", "merge_request", "milestone", "note", "project", "snippet", "user"]).optional().describe("If defined, returns events with the specified target type"),
1736
+ before: z.string().optional().describe("If defined, Returns events created before the specified date (YYYY-MM-DD format). To include events on 2025-08-29, use before=2025-08-30"),
1737
+ after: z.string().optional().describe("If defined, Returns events created after the specified date (YYYY-MM-DD format). To include events on 2025-08-29, use after=2025-08-28"),
1738
+ scope: z.string().optional().describe("Include all events across a user's projects"),
1739
+ sort: z.enum(["asc", "desc"]).optional().describe("Direction to sort the results by creation date. Default: desc"),
1740
+ page: z.number().optional().describe("Returns the specified results page. Default: 1"),
1741
+ per_page: z.number().optional().describe("Number of results per page. Default: 20"),
1742
+ });
1743
+ // Get project events schema
1744
+ export const GetProjectEventsSchema = z.object({
1745
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1746
+ action: z.string().optional().describe("If defined, returns events with the specified action type"),
1747
+ target_type: z.enum(["epic", "issue", "merge_request", "milestone", "note", "project", "snippet", "user"]).optional().describe("If defined, returns events with the specified target type"),
1748
+ before: z.string().optional().describe("If defined, Returns events created before the specified date (YYYY-MM-DD format). To include events on 2025-08-29, use before=2025-08-30"),
1749
+ after: z.string().optional().describe("If defined, Returns events created after the specified date (YYYY-MM-DD format). To include events on 2025-08-29, use after=2025-08-28"),
1750
+ sort: z.enum(["asc", "desc"]).optional().describe("Direction to sort the results by creation date. Default: desc"),
1751
+ page: z.number().optional().describe("Returns the specified results page. Default: 1"),
1752
+ per_page: z.number().optional().describe("Number of results per page. Default: 20"),
1753
+ });