@zereight/mcp-gitlab 2.0.28 → 2.0.30

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
@@ -188,9 +188,7 @@ export const ListPipelinesSchema = z
188
188
  .describe("The status of pipelines"),
189
189
  ref: z.string().optional().describe("The ref of pipelines"),
190
190
  sha: z.string().optional().describe("The SHA of pipelines"),
191
- yaml_errors: z.boolean()
192
- .optional()
193
- .describe("Returns pipelines with invalid configurations"),
191
+ yaml_errors: z.boolean().optional().describe("Returns pipelines with invalid configurations"),
194
192
  username: z.string().optional().describe("The username of the user who triggered pipelines"),
195
193
  updated_after: z
196
194
  .string()
@@ -300,7 +298,7 @@ export const PlayPipelineJobSchema = z.object({
300
298
  });
301
299
  // Schema for retrying a job
302
300
  export const RetryPipelineJobSchema = PipelineJobControlSchema;
303
- // Schema for canceling a job
301
+ // Schema for canceling a job
304
302
  export const CancelPipelineJobSchema = z.object({
305
303
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
306
304
  job_id: z.coerce.string().describe("The ID of the job"),
@@ -772,7 +770,8 @@ export const LineRangeSchema = z
772
770
  })
773
771
  .describe("Line range for multiline comments on GitLab merge request diffs. VALIDATION RULES: 1) line_code is critical for GitLab API success, 2) start/end must have consistent types, 3) line numbers must form valid range, 4) get line_code from GitLab diff API, never generate manually.");
774
772
  // Discussion related schemas
775
- export const GitLabDiscussionNoteSchema = z.object({
773
+ export const GitLabDiscussionNoteSchema = z
774
+ .object({
776
775
  id: z.coerce.string(),
777
776
  type: z.enum(["DiscussionNote", "DiffNote", "Note"]).nullable().optional(), // Allow null type for regular notes
778
777
  body: z.string().optional(),
@@ -816,7 +815,8 @@ export const GitLabDiscussionNoteSchema = z.object({
816
815
  })
817
816
  .passthrough() // Allow additional fields
818
817
  .optional(),
819
- }).passthrough(); // Allow additional fields that GitLab might return
818
+ })
819
+ .passthrough(); // Allow additional fields that GitLab might return
820
820
  // Reusable pagination schema for GitLab API responses.
821
821
  // See https://docs.gitlab.com/api/rest/#pagination
822
822
  export const GitLabPaginationSchema = z.object({
@@ -855,7 +855,10 @@ export const ListMergeRequestDiscussionsSchema = ProjectParamsSchema.extend({
855
855
  export const GetMergeRequestNotesSchema = ProjectParamsSchema.extend({
856
856
  merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
857
857
  sort: z.enum(["asc", "desc"]).optional().describe("The sort order of the notes"),
858
- order_by: z.enum(["created_at", "updated_at"]).optional().describe("The field to sort the notes by"),
858
+ order_by: z
859
+ .enum(["created_at", "updated_at"])
860
+ .optional()
861
+ .describe("The field to sort the notes by"),
859
862
  per_page: z.coerce.number().optional().describe("Number of items per page"),
860
863
  page: z.coerce.number().optional().describe("Page number for pagination"),
861
864
  });
@@ -970,7 +973,11 @@ export const CreateIssueSchema = ProjectParamsSchema.extend({
970
973
  assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign"),
971
974
  labels: z.array(z.string()).optional().describe("Array of label names"),
972
975
  milestone_id: z.coerce.string().optional().describe("Milestone ID to assign"),
973
- issue_type: z.enum(["issue", "incident", "test_case", "task"]).describe("the type of issue. One of issue, incident, test_case or task.").nullish().default("issue"),
976
+ issue_type: z
977
+ .enum(["issue", "incident", "test_case", "task"])
978
+ .describe("the type of issue. One of issue, incident, test_case or task.")
979
+ .nullish()
980
+ .default("issue"),
974
981
  });
975
982
  const MergeRequestOptionsSchema = {
976
983
  title: z.string().describe("Merge request title"),
@@ -986,10 +993,14 @@ const MergeRequestOptionsSchema = {
986
993
  labels: z.array(z.string()).optional().describe("Labels for the MR"),
987
994
  draft: z.boolean().optional().describe("Create as draft merge request"),
988
995
  allow_collaboration: z.boolean().optional().describe("Allow commits from upstream members"),
989
- remove_source_branch: z.boolean().nullable()
996
+ remove_source_branch: z
997
+ .boolean()
998
+ .nullable()
990
999
  .optional()
991
1000
  .describe("Flag indicating if a merge request should remove the source branch when merging."),
992
- squash: z.boolean().nullable()
1001
+ squash: z
1002
+ .boolean()
1003
+ .nullable()
993
1004
  .optional()
994
1005
  .describe("If true, squash all commits into a single commit on merge."),
995
1006
  };
@@ -1006,7 +1017,8 @@ export const CreateBranchSchema = ProjectParamsSchema.extend({
1006
1017
  export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
1007
1018
  from: z.string().describe("The base branch or commit SHA to compare from"),
1008
1019
  to: z.string().describe("The target branch or commit SHA to compare to"),
1009
- straight: z.boolean()
1020
+ straight: z
1021
+ .boolean()
1010
1022
  .optional()
1011
1023
  .describe("Comparison method: false for '...' (default), true for '--'"),
1012
1024
  excluded_file_patterns: z
@@ -1041,18 +1053,40 @@ export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
1041
1053
  });
1042
1054
  export const MergeMergeRequestSchema = ProjectParamsSchema.extend({
1043
1055
  merge_request_iid: z.coerce.string().optional().describe("The IID of a merge request"),
1044
- auto_merge: z.boolean().optional().default(false).describe("If true, the merge request merges when the pipeline succeeds."),
1056
+ auto_merge: z
1057
+ .boolean()
1058
+ .optional()
1059
+ .default(false)
1060
+ .describe("If true, the merge request merges when the pipeline succeeds."),
1045
1061
  merge_commit_message: z.string().optional().describe("Custom merge commit message"),
1046
- 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"),
1047
- should_remove_source_branch: z.boolean().optional().default(false).describe("Remove source branch after merge"),
1062
+ merge_when_pipeline_succeeds: z
1063
+ .boolean()
1064
+ .optional()
1065
+ .default(false)
1066
+ .describe("If true, the merge request merges when the pipeline succeeds.in GitLab 17.11. Use"),
1067
+ should_remove_source_branch: z
1068
+ .boolean()
1069
+ .optional()
1070
+ .default(false)
1071
+ .describe("Remove source branch after merge"),
1048
1072
  squash_commit_message: z.string().optional().describe("Custom squash commit message"),
1049
- squash: z.boolean().optional().default(false).describe("Squash commits into a single commit when merging"),
1073
+ squash: z
1074
+ .boolean()
1075
+ .optional()
1076
+ .default(false)
1077
+ .describe("Squash commits into a single commit when merging"),
1050
1078
  });
1051
1079
  // Merge Request Approval schemas
1052
1080
  export const ApproveMergeRequestSchema = ProjectParamsSchema.extend({
1053
1081
  merge_request_iid: z.coerce.string().describe("The IID of the merge request to approve"),
1054
- sha: z.string().optional().describe("The HEAD of the merge request. Optional, but used to ensure the merge request hasn't changed since you last reviewed it"),
1055
- approval_password: z.string().optional().describe("Current user's password. Required if 'Require user re-authentication to approve' is enabled in the project settings"),
1082
+ sha: z
1083
+ .string()
1084
+ .optional()
1085
+ .describe("The HEAD of the merge request. Optional, but used to ensure the merge request hasn't changed since you last reviewed it"),
1086
+ approval_password: z
1087
+ .string()
1088
+ .optional()
1089
+ .describe("Current user's password. Required if 'Require user re-authentication to approve' is enabled in the project settings"),
1056
1090
  });
1057
1091
  export const UnapproveMergeRequestSchema = ProjectParamsSchema.extend({
1058
1092
  merge_request_iid: z.coerce.string().describe("The IID of the merge request to unapprove"),
@@ -1073,21 +1107,26 @@ export const GitLabApprovalRuleSchema = z.object({
1073
1107
  eligible_approvers: z.array(GitLabApprovalUserSchema).optional(),
1074
1108
  approvals_required: z.number(),
1075
1109
  users: z.array(GitLabApprovalUserSchema).optional(),
1076
- groups: z.array(z.object({
1110
+ groups: z
1111
+ .array(z.object({
1077
1112
  id: z.coerce.string(),
1078
1113
  name: z.string(),
1079
1114
  path: z.string(),
1080
1115
  full_path: z.string(),
1081
1116
  avatar_url: z.string().nullable().optional(),
1082
1117
  web_url: z.string(),
1083
- })).optional(),
1118
+ }))
1119
+ .optional(),
1084
1120
  contains_hidden_groups: z.boolean().optional(),
1085
1121
  approved_by: z.array(GitLabApprovalUserSchema).optional(),
1086
- source_rule: z.object({
1122
+ source_rule: z
1123
+ .object({
1087
1124
  id: z.coerce.string().optional(),
1088
1125
  name: z.string().optional(),
1089
1126
  rule_type: z.string().optional(),
1090
- }).nullable().optional(),
1127
+ })
1128
+ .nullable()
1129
+ .optional(),
1091
1130
  approved: z.boolean().optional(),
1092
1131
  });
1093
1132
  export const GitLabMergeRequestApprovalStateSchema = z.object({
@@ -1107,7 +1146,8 @@ export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
1107
1146
  export const ListMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
1108
1147
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
1109
1148
  per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
1110
- unidiff: z.boolean()
1149
+ unidiff: z
1150
+ .boolean()
1111
1151
  .optional()
1112
1152
  .describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
1113
1153
  });
@@ -1117,7 +1157,8 @@ export const ListMergeRequestVersionsSchema = ProjectParamsSchema.extend({
1117
1157
  });
1118
1158
  export const GetMergeRequestVersionSchema = ListMergeRequestVersionsSchema.extend({
1119
1159
  version_id: z.coerce.string().describe("The ID of the merge request diff version"),
1120
- unidiff: z.boolean()
1160
+ unidiff: z
1161
+ .boolean()
1121
1162
  .optional()
1122
1163
  .describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
1123
1164
  });
@@ -1177,7 +1218,10 @@ export const ListIssuesSchema = z
1177
1218
  // Merge Requests API operation schemas
1178
1219
  export const ListMergeRequestsSchema = z
1179
1220
  .object({
1180
- project_id: z.coerce.string().optional().describe("Project ID or URL-encoded path (optional - if not provided, lists all merge requests the user has access to)"),
1221
+ project_id: z.coerce
1222
+ .string()
1223
+ .optional()
1224
+ .describe("Project ID or URL-encoded path (optional - if not provided, lists all merge requests the user has access to)"),
1181
1225
  assignee_id: z.coerce
1182
1226
  .string()
1183
1227
  .optional()
@@ -1276,7 +1320,9 @@ export const UpdateIssueSchema = z.object({
1276
1320
  milestone_id: z.coerce.string().optional().describe("Milestone ID to assign"),
1277
1321
  state_event: z.enum(["close", "reopen"]).optional().describe("Update issue state (close/reopen)"),
1278
1322
  weight: z.number().optional().describe("Weight of the issue (0-9)"),
1279
- issue_type: z.enum(["issue", "incident", "test_case", "task"]).describe("the type of issue. One of issue, incident, test_case or task."),
1323
+ issue_type: z
1324
+ .enum(["issue", "incident", "test_case", "task"])
1325
+ .describe("the type of issue. One of issue, incident, test_case or task."),
1280
1326
  });
1281
1327
  export const DeleteIssueSchema = z.object({
1282
1328
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
@@ -1332,11 +1378,10 @@ export const GetProjectSchema = z.object({
1332
1378
  export const ListProjectsSchema = z
1333
1379
  .object({
1334
1380
  search: z.string().optional().describe("Search term for projects"),
1335
- search_namespaces: z.boolean()
1336
- .optional()
1337
- .describe("Needs to be true if search is full path"),
1381
+ search_namespaces: z.boolean().optional().describe("Needs to be true if search is full path"),
1338
1382
  owned: z.boolean().optional().describe("Filter for projects owned by current user"),
1339
- membership: z.boolean()
1383
+ membership: z
1384
+ .boolean()
1340
1385
  .optional()
1341
1386
  .describe("Filter for projects where current user is a member"),
1342
1387
  simple: z.boolean().optional().describe("Return only limited fields"),
@@ -1476,19 +1521,57 @@ export const GitLabWikiPageSchema = z.object({
1476
1521
  // Extremely flexible position schema for API responses - accepts any structure
1477
1522
  // Strict position schema for creating draft notes and merge request threads
1478
1523
  export const MergeRequestThreadPositionCreateSchema = z.object({
1479
- base_sha: z.string().describe("REQUIRED: Base commit SHA in the source branch. Get this from merge request diff_refs.base_sha."),
1480
- head_sha: z.string().describe("REQUIRED: SHA referencing HEAD of the source branch. Get this from merge request diff_refs.head_sha."),
1481
- start_sha: z.string().describe("REQUIRED: SHA referencing the start commit of the source branch. Get this from merge request diff_refs.start_sha."),
1482
- position_type: z.enum(["text", "image", "file"]).describe("REQUIRED: Position type. Use 'text' for code diffs, 'image' for image diffs, 'file' for file-level comments."),
1483
- new_path: z.string().nullable().optional().describe("File path after changes. REQUIRED for most diff comments. Use same as old_path if file wasn't renamed."),
1484
- old_path: z.string().nullable().optional().describe("File path before changes. REQUIRED for most diff comments. Use same as new_path if file wasn't renamed."),
1485
- new_line: z.number().nullable().optional().describe("Line number in modified file (after changes). Use for added lines or context lines. NULL for deleted lines. For single-line comments on new lines."),
1486
- old_line: z.number().nullable().optional().describe("Line number in original file (before changes). Use for deleted lines or context lines. NULL for added lines. For single-line comments on old lines."),
1487
- line_range: LineRangeSchema.nullable().optional().describe("MULTILINE COMMENTS: Specify start/end line positions for commenting on multiple lines. Alternative to single old_line/new_line."),
1488
- width: z.number().optional().describe("IMAGE DIFFS ONLY: Width of the image (for position_type='image')."),
1489
- height: z.number().optional().describe("IMAGE DIFFS ONLY: Height of the image (for position_type='image')."),
1490
- x: z.number().optional().describe("IMAGE DIFFS ONLY: X coordinate on the image (for position_type='image')."),
1491
- y: z.number().optional().describe("IMAGE DIFFS ONLY: Y coordinate on the image (for position_type='image')."),
1524
+ base_sha: z
1525
+ .string()
1526
+ .describe("REQUIRED: Base commit SHA in the source branch. Get this from merge request diff_refs.base_sha."),
1527
+ head_sha: z
1528
+ .string()
1529
+ .describe("REQUIRED: SHA referencing HEAD of the source branch. Get this from merge request diff_refs.head_sha."),
1530
+ start_sha: z
1531
+ .string()
1532
+ .describe("REQUIRED: SHA referencing the start commit of the source branch. Get this from merge request diff_refs.start_sha."),
1533
+ position_type: z
1534
+ .enum(["text", "image", "file"])
1535
+ .describe("REQUIRED: Position type. Use 'text' for code diffs, 'image' for image diffs, 'file' for file-level comments."),
1536
+ new_path: z
1537
+ .string()
1538
+ .nullable()
1539
+ .optional()
1540
+ .describe("File path after changes. REQUIRED for most diff comments. Use same as old_path if file wasn't renamed."),
1541
+ old_path: z
1542
+ .string()
1543
+ .nullable()
1544
+ .optional()
1545
+ .describe("File path before changes. REQUIRED for most diff comments. Use same as new_path if file wasn't renamed."),
1546
+ new_line: z
1547
+ .number()
1548
+ .nullable()
1549
+ .optional()
1550
+ .describe("Line number in modified file (after changes). Use for added lines or context lines. NULL for deleted lines. For single-line comments on new lines."),
1551
+ old_line: z
1552
+ .number()
1553
+ .nullable()
1554
+ .optional()
1555
+ .describe("Line number in original file (before changes). Use for deleted lines or context lines. NULL for added lines. For single-line comments on old lines."),
1556
+ line_range: LineRangeSchema.nullable()
1557
+ .optional()
1558
+ .describe("MULTILINE COMMENTS: Specify start/end line positions for commenting on multiple lines. Alternative to single old_line/new_line."),
1559
+ width: z
1560
+ .number()
1561
+ .optional()
1562
+ .describe("IMAGE DIFFS ONLY: Width of the image (for position_type='image')."),
1563
+ height: z
1564
+ .number()
1565
+ .optional()
1566
+ .describe("IMAGE DIFFS ONLY: Height of the image (for position_type='image')."),
1567
+ x: z
1568
+ .number()
1569
+ .optional()
1570
+ .describe("IMAGE DIFFS ONLY: X coordinate on the image (for position_type='image')."),
1571
+ y: z
1572
+ .number()
1573
+ .optional()
1574
+ .describe("IMAGE DIFFS ONLY: Y coordinate on the image (for position_type='image')."),
1492
1575
  });
1493
1576
  // Schema for creating/sending position to GitLab API (stricter)
1494
1577
  export const MergeRequestThreadPositionSchema = z.object({
@@ -1524,7 +1607,9 @@ export const MergeRequestThreadPositionSchema = z.object({
1524
1607
  .nullable()
1525
1608
  .optional()
1526
1609
  .describe("Line number in original file (before changes). Use for deleted lines or context lines. NULL for added lines. For single-line comments on old lines."),
1527
- line_range: LineRangeSchema.nullable().optional().describe("MULTILINE COMMENTS: Specify start/end line positions for commenting on multiple lines. Alternative to single old_line/new_line."),
1610
+ line_range: LineRangeSchema.nullable()
1611
+ .optional()
1612
+ .describe("MULTILINE COMMENTS: Specify start/end line positions for commenting on multiple lines. Alternative to single old_line/new_line."),
1528
1613
  width: z
1529
1614
  .number()
1530
1615
  .nullable()
@@ -1547,22 +1632,26 @@ export const MergeRequestThreadPositionSchema = z.object({
1547
1632
  .describe("IMAGE DIFFS ONLY: Y coordinate on the image (for position_type='image')."),
1548
1633
  });
1549
1634
  // Draft Notes API schemas
1550
- export const GitLabDraftNoteSchema = z.object({
1635
+ export const GitLabDraftNoteSchema = z
1636
+ .object({
1551
1637
  id: z.coerce.string(),
1552
1638
  author: GitLabUserSchema.optional(),
1553
1639
  body: z.string().optional(),
1554
1640
  note: z.string().optional(), // Some APIs might use 'note' instead of 'body'
1555
1641
  created_at: z.string().optional(),
1556
1642
  updated_at: z.string().optional(),
1557
- position: MergeRequestThreadPositionSchema.nullable().optional(),
1643
+ discussion_id: z.string().nullable().optional(),
1644
+ position: z.record(z.unknown()).nullable().optional(),
1558
1645
  resolve_discussion: z.boolean().optional(),
1559
- }).transform((data) => ({
1646
+ })
1647
+ .transform(data => ({
1560
1648
  // Normalize the response to always have consistent field names
1561
1649
  id: data.id,
1562
1650
  author: data.author,
1563
1651
  body: data.body || data.note || "",
1564
1652
  created_at: data.created_at || "",
1565
1653
  updated_at: data.updated_at || "",
1654
+ discussion_id: data.discussion_id || null,
1566
1655
  position: data.position,
1567
1656
  resolve_discussion: data.resolve_discussion,
1568
1657
  }));
@@ -1579,8 +1668,15 @@ export const ListDraftNotesSchema = ProjectParamsSchema.extend({
1579
1668
  export const CreateDraftNoteSchema = ProjectParamsSchema.extend({
1580
1669
  merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
1581
1670
  body: z.string().describe("The content of the draft note"),
1671
+ in_reply_to_discussion_id: z.coerce
1672
+ .string()
1673
+ .optional()
1674
+ .describe("The ID of a discussion the draft note replies to"),
1582
1675
  position: MergeRequestThreadPositionSchema.optional().describe("Position when creating a diff note"),
1583
- resolve_discussion: z.boolean().optional().describe("Whether to resolve the discussion when publishing"),
1676
+ resolve_discussion: z
1677
+ .boolean()
1678
+ .optional()
1679
+ .describe("Whether to resolve the discussion when publishing"),
1584
1680
  });
1585
1681
  // Update draft note schema
1586
1682
  export const UpdateDraftNoteSchema = ProjectParamsSchema.extend({
@@ -1588,7 +1684,10 @@ export const UpdateDraftNoteSchema = ProjectParamsSchema.extend({
1588
1684
  draft_note_id: z.coerce.string().describe("The ID of the draft note"),
1589
1685
  body: z.string().optional().describe("The content of the draft note"),
1590
1686
  position: MergeRequestThreadPositionSchema.optional().describe("Position when creating a diff note"),
1591
- resolve_discussion: z.boolean().optional().describe("Whether to resolve the discussion when publishing"),
1687
+ resolve_discussion: z
1688
+ .boolean()
1689
+ .optional()
1690
+ .describe("Whether to resolve the discussion when publishing"),
1592
1691
  });
1593
1692
  // Delete draft note schema
1594
1693
  export const DeleteDraftNoteSchema = ProjectParamsSchema.extend({
@@ -1692,10 +1791,9 @@ export const ListCommitsSchema = z.object({
1692
1791
  path: z.string().optional().describe("The file path"),
1693
1792
  author: z.string().optional().describe("Search commits by commit author"),
1694
1793
  all: z.boolean().optional().describe("Retrieve every commit from the repository"),
1695
- with_stats: z.boolean()
1696
- .optional()
1697
- .describe("Stats about each commit are added to the response"),
1698
- first_parent: z.boolean()
1794
+ with_stats: z.boolean().optional().describe("Stats about each commit are added to the response"),
1795
+ first_parent: z
1796
+ .boolean()
1699
1797
  .optional()
1700
1798
  .describe("Follow only the first parent commit upon seeing a merge commit"),
1701
1799
  order: z.enum(["default", "topo"]).optional().describe("List commits in order"),
@@ -1711,11 +1809,17 @@ export const GetCommitSchema = z.object({
1711
1809
  export const GetCommitDiffSchema = z.object({
1712
1810
  project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
1713
1811
  sha: z.string().describe("The commit hash or name of a repository branch or tag"),
1714
- full_diff: z.boolean().optional().describe("Whether to return the full diff or only first page (default: false)"),
1812
+ full_diff: z
1813
+ .boolean()
1814
+ .optional()
1815
+ .describe("Whether to return the full diff or only first page (default: false)"),
1715
1816
  });
1716
1817
  // Schema for listing issues assigned to the current user
1717
1818
  export const MyIssuesSchema = z.object({
1718
- project_id: z.string().optional().describe("Project ID or URL-encoded path (optional when GITLAB_PROJECT_ID is set)"),
1819
+ project_id: z
1820
+ .string()
1821
+ .optional()
1822
+ .describe("Project ID or URL-encoded path (optional when GITLAB_PROJECT_ID is set)"),
1719
1823
  state: z
1720
1824
  .enum(["opened", "closed", "all"])
1721
1825
  .optional()
@@ -1723,10 +1827,22 @@ export const MyIssuesSchema = z.object({
1723
1827
  labels: z.array(z.string()).optional().describe("Array of label names to filter by"),
1724
1828
  milestone: z.string().optional().describe("Milestone title to filter by"),
1725
1829
  search: z.string().optional().describe("Search for specific terms in title and description"),
1726
- created_after: z.string().optional().describe("Return issues created after the given time (ISO 8601)"),
1727
- created_before: z.string().optional().describe("Return issues created before the given time (ISO 8601)"),
1728
- updated_after: z.string().optional().describe("Return issues updated after the given time (ISO 8601)"),
1729
- updated_before: z.string().optional().describe("Return issues updated before the given time (ISO 8601)"),
1830
+ created_after: z
1831
+ .string()
1832
+ .optional()
1833
+ .describe("Return issues created after the given time (ISO 8601)"),
1834
+ created_before: z
1835
+ .string()
1836
+ .optional()
1837
+ .describe("Return issues created before the given time (ISO 8601)"),
1838
+ updated_after: z
1839
+ .string()
1840
+ .optional()
1841
+ .describe("Return issues updated after the given time (ISO 8601)"),
1842
+ updated_before: z
1843
+ .string()
1844
+ .optional()
1845
+ .describe("Return issues updated before the given time (ISO 8601)"),
1730
1846
  per_page: z.number().optional().describe("Number of items per page (default: 20, max: 100)"),
1731
1847
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
1732
1848
  });
@@ -1773,7 +1889,10 @@ export const DownloadAttachmentSchema = z.object({
1773
1889
  project_id: z.string().describe("Project ID or URL-encoded path of the project"),
1774
1890
  secret: z.string().describe("The 32-character secret of the upload"),
1775
1891
  filename: z.string().describe("The filename of the upload"),
1776
- local_path: z.string().optional().describe("Local path to save the file (optional, defaults to current directory)"),
1892
+ local_path: z
1893
+ .string()
1894
+ .optional()
1895
+ .describe("Local path to save the file (optional, defaults to current directory)"),
1777
1896
  });
1778
1897
  export const GroupIteration = z.object({
1779
1898
  id: z.coerce.string(),
@@ -1804,10 +1923,12 @@ export const ListGroupIterationsSchema = z
1804
1923
  .array(z.enum(["title", "cadence_title"]))
1805
1924
  .optional()
1806
1925
  .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]."),
1807
- include_ancestors: z.boolean()
1926
+ include_ancestors: z
1927
+ .boolean()
1808
1928
  .optional()
1809
1929
  .describe("Include iterations for group and its ancestors. Defaults to true."),
1810
- include_descendants: z.boolean()
1930
+ include_descendants: z
1931
+ .boolean()
1811
1932
  .optional()
1812
1933
  .describe("Include iterations for group and its descendants. Defaults to false."),
1813
1934
  updated_before: z
@@ -1829,7 +1950,8 @@ export const GitLabEventAuthorSchema = z.object({
1829
1950
  avatar_url: z.string().nullable(),
1830
1951
  web_url: z.string(),
1831
1952
  });
1832
- export const GitLabEventSchema = z.object({
1953
+ export const GitLabEventSchema = z
1954
+ .object({
1833
1955
  id: z.coerce.string(),
1834
1956
  project_id: z.coerce.string(),
1835
1957
  action_name: z.string(),
@@ -1843,26 +1965,57 @@ export const GitLabEventSchema = z.object({
1843
1965
  author_username: z.string(),
1844
1966
  imported: z.boolean(),
1845
1967
  imported_from: z.string(),
1846
- }).passthrough(); // Allow additional fields
1968
+ })
1969
+ .passthrough(); // Allow additional fields
1847
1970
  // List events schema
1848
1971
  export const ListEventsSchema = z.object({
1849
- action: z.string().optional().describe("If defined, returns events with the specified action type"),
1850
- target_type: z.enum(["epic", "issue", "merge_request", "milestone", "note", "project", "snippet", "user"]).optional().describe("If defined, returns events with the specified target type"),
1851
- 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"),
1852
- 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"),
1972
+ action: z
1973
+ .string()
1974
+ .optional()
1975
+ .describe("If defined, returns events with the specified action type"),
1976
+ target_type: z
1977
+ .enum(["epic", "issue", "merge_request", "milestone", "note", "project", "snippet", "user"])
1978
+ .optional()
1979
+ .describe("If defined, returns events with the specified target type"),
1980
+ before: z
1981
+ .string()
1982
+ .optional()
1983
+ .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"),
1984
+ after: z
1985
+ .string()
1986
+ .optional()
1987
+ .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"),
1853
1988
  scope: z.string().optional().describe("Include all events across a user's projects"),
1854
- sort: z.enum(["asc", "desc"]).optional().describe("Direction to sort the results by creation date. Default: desc"),
1989
+ sort: z
1990
+ .enum(["asc", "desc"])
1991
+ .optional()
1992
+ .describe("Direction to sort the results by creation date. Default: desc"),
1855
1993
  page: z.number().optional().describe("Returns the specified results page. Default: 1"),
1856
1994
  per_page: z.number().optional().describe("Number of results per page. Default: 20"),
1857
1995
  });
1858
1996
  // Get project events schema
1859
1997
  export const GetProjectEventsSchema = z.object({
1860
1998
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1861
- action: z.string().optional().describe("If defined, returns events with the specified action type"),
1862
- target_type: z.enum(["epic", "issue", "merge_request", "milestone", "note", "project", "snippet", "user"]).optional().describe("If defined, returns events with the specified target type"),
1863
- 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"),
1864
- 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"),
1865
- sort: z.enum(["asc", "desc"]).optional().describe("Direction to sort the results by creation date. Default: desc"),
1999
+ action: z
2000
+ .string()
2001
+ .optional()
2002
+ .describe("If defined, returns events with the specified action type"),
2003
+ target_type: z
2004
+ .enum(["epic", "issue", "merge_request", "milestone", "note", "project", "snippet", "user"])
2005
+ .optional()
2006
+ .describe("If defined, returns events with the specified target type"),
2007
+ before: z
2008
+ .string()
2009
+ .optional()
2010
+ .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"),
2011
+ after: z
2012
+ .string()
2013
+ .optional()
2014
+ .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"),
2015
+ sort: z
2016
+ .enum(["asc", "desc"])
2017
+ .optional()
2018
+ .describe("Direction to sort the results by creation date. Default: desc"),
1866
2019
  page: z.number().optional().describe("Returns the specified results page. Default: 1"),
1867
2020
  per_page: z.number().optional().describe("Number of results per page. Default: 20"),
1868
2021
  });
@@ -1885,10 +2038,7 @@ export const GitLabMergeRequestVersionDetailSchema = GitLabMergeRequestVersionSc
1885
2038
  // GraphQL generic execution schema
1886
2039
  export const ExecuteGraphQLSchema = z.object({
1887
2040
  query: z.string().describe("GraphQL query string"),
1888
- variables: z
1889
- .record(z.any())
1890
- .optional()
1891
- .describe("Variables object for the GraphQL query"),
2041
+ variables: z.record(z.any()).optional().describe("Variables object for the GraphQL query"),
1892
2042
  });
1893
2043
  // Release schemas
1894
2044
  export const GitLabReleaseAssetLinkSchema = z.object({
@@ -1920,15 +2070,18 @@ export const GitLabReleaseSchema = z.object({
1920
2070
  description_html: z.string().nullable().optional(),
1921
2071
  created_at: z.string(),
1922
2072
  released_at: z.string().nullable().optional(),
1923
- author: z.object({
2073
+ author: z
2074
+ .object({
1924
2075
  id: z.number(),
1925
2076
  name: z.string(),
1926
2077
  username: z.string(),
1927
2078
  state: z.string(),
1928
2079
  avatar_url: z.string().nullable().optional(),
1929
2080
  web_url: z.string(),
1930
- }).optional(),
1931
- commit: z.object({
2081
+ })
2082
+ .optional(),
2083
+ commit: z
2084
+ .object({
1932
2085
  id: z.string(),
1933
2086
  short_id: z.string(),
1934
2087
  title: z.string(),
@@ -1941,13 +2094,15 @@ export const GitLabReleaseSchema = z.object({
1941
2094
  committer_name: z.string(),
1942
2095
  committer_email: z.string(),
1943
2096
  committed_date: z.string(),
1944
- }).optional(),
2097
+ })
2098
+ .optional(),
1945
2099
  milestones: z.array(GitLabMilestonesSchema).optional(),
1946
2100
  commit_path: z.string().optional(),
1947
2101
  tag_path: z.string().optional(),
1948
2102
  assets: GitLabReleaseAssetsSchema.optional(),
1949
2103
  evidences: z.array(GitLabReleaseEvidenceSchema).optional(),
1950
- _links: z.object({
2104
+ _links: z
2105
+ .object({
1951
2106
  closed_issues_url: z.string().optional(),
1952
2107
  closed_merge_requests_url: z.string().optional(),
1953
2108
  edit_url: z.string().optional(),
@@ -1955,7 +2110,8 @@ export const GitLabReleaseSchema = z.object({
1955
2110
  opened_issues_url: z.string().optional(),
1956
2111
  opened_merge_requests_url: z.string().optional(),
1957
2112
  self: z.string().optional(),
1958
- }).optional(),
2113
+ })
2114
+ .optional(),
1959
2115
  upcoming_release: z.boolean().optional(),
1960
2116
  historical_release: z.boolean().optional(),
1961
2117
  });
@@ -1989,7 +2145,10 @@ export const CreateReleaseSchema = z.object({
1989
2145
  tag_name: z.string().describe("The tag where the release is created from"),
1990
2146
  name: z.string().optional().describe("The release name"),
1991
2147
  tag_message: z.string().optional().describe("Message to use if creating a new annotated tag"),
1992
- description: z.string().optional().describe("The description of the release. You can use Markdown."),
2148
+ description: z
2149
+ .string()
2150
+ .optional()
2151
+ .describe("The description of the release. You can use Markdown."),
1993
2152
  ref: z
1994
2153
  .string()
1995
2154
  .optional()
@@ -2002,9 +2161,16 @@ export const CreateReleaseSchema = z.object({
2002
2161
  .object({
2003
2162
  links: z
2004
2163
  .array(z.object({
2005
- name: z.string().describe("The name of the link. Link names must be unique within the release."),
2006
- url: z.string().describe("The URL of the link. Link URLs must be unique within the release."),
2007
- direct_asset_path: z.string().optional().describe("Optional path for a direct asset link."),
2164
+ name: z
2165
+ .string()
2166
+ .describe("The name of the link. Link names must be unique within the release."),
2167
+ url: z
2168
+ .string()
2169
+ .describe("The URL of the link. Link URLs must be unique within the release."),
2170
+ direct_asset_path: z
2171
+ .string()
2172
+ .optional()
2173
+ .describe("Optional path for a direct asset link."),
2008
2174
  link_type: z
2009
2175
  .enum(["other", "runbook", "image", "package"])
2010
2176
  .optional()
@@ -2023,7 +2189,10 @@ export const UpdateReleaseSchema = z.object({
2023
2189
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
2024
2190
  tag_name: z.string().describe("The Git tag the release is associated with"),
2025
2191
  name: z.string().optional().describe("The release name"),
2026
- description: z.string().optional().describe("The description of the release. You can use Markdown."),
2192
+ description: z
2193
+ .string()
2194
+ .optional()
2195
+ .describe("The description of the release. You can use Markdown."),
2027
2196
  milestones: z
2028
2197
  .array(z.string())
2029
2198
  .optional()
@@ -2044,5 +2213,7 @@ export const CreateReleaseEvidenceSchema = z.object({
2044
2213
  export const DownloadReleaseAssetSchema = z.object({
2045
2214
  project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
2046
2215
  tag_name: z.string().describe("The Git tag the release is associated with"),
2047
- direct_asset_path: z.string().describe("Path to the release asset file as specified when creating or updating its link"),
2216
+ direct_asset_path: z
2217
+ .string()
2218
+ .describe("Path to the release asset file as specified when creating or updating its link"),
2048
2219
  });