@zereight/mcp-gitlab 1.0.71 → 1.0.74

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,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { flexibleBoolean } from "./customSchemas.js";
2
3
  // Base schemas for common types
3
4
  export const GitLabAuthorSchema = z.object({
4
5
  name: z.string(),
@@ -7,8 +8,8 @@ export const GitLabAuthorSchema = z.object({
7
8
  });
8
9
  // Pipeline related schemas
9
10
  export const GitLabPipelineSchema = z.object({
10
- id: z.string().or(z.number()),
11
- project_id: z.string().or(z.number()),
11
+ id: z.coerce.string(),
12
+ project_id: z.coerce.string(),
12
13
  sha: z.string(),
13
14
  ref: z.string(),
14
15
  status: z.string(),
@@ -22,7 +23,7 @@ export const GitLabPipelineSchema = z.object({
22
23
  coverage: z.number().nullable().optional(),
23
24
  user: z
24
25
  .object({
25
- id: z.string().or(z.number()),
26
+ id: z.coerce.string(),
26
27
  name: z.string(),
27
28
  username: z.string(),
28
29
  avatar_url: z.string().nullable().optional(),
@@ -35,7 +36,7 @@ export const GitLabPipelineSchema = z.object({
35
36
  label: z.string().optional(),
36
37
  group: z.string().optional(),
37
38
  tooltip: z.string().optional(),
38
- has_details: z.boolean().optional(),
39
+ has_details: flexibleBoolean.optional(),
39
40
  details_path: z.string().optional(),
40
41
  illustration: z
41
42
  .object({
@@ -51,12 +52,12 @@ export const GitLabPipelineSchema = z.object({
51
52
  });
52
53
  // Pipeline job related schemas
53
54
  export const GitLabPipelineJobSchema = z.object({
54
- id: z.string().or(z.number()),
55
+ id: z.coerce.string(),
55
56
  status: z.string(),
56
57
  stage: z.string(),
57
58
  name: z.string(),
58
59
  ref: z.string(),
59
- tag: z.boolean(),
60
+ tag: flexibleBoolean,
60
61
  coverage: z.number().nullable().optional(),
61
62
  created_at: z.string(),
62
63
  started_at: z.string().nullable().optional(),
@@ -64,7 +65,7 @@ export const GitLabPipelineJobSchema = z.object({
64
65
  duration: z.number().nullable().optional(),
65
66
  user: z
66
67
  .object({
67
- id: z.string().or(z.number()),
68
+ id: z.coerce.string(),
68
69
  name: z.string(),
69
70
  username: z.string(),
70
71
  avatar_url: z.string().nullable().optional(),
@@ -81,8 +82,8 @@ export const GitLabPipelineJobSchema = z.object({
81
82
  .optional(),
82
83
  pipeline: z
83
84
  .object({
84
- id: z.string().or(z.number()),
85
- project_id: z.string().or(z.number()),
85
+ id: z.coerce.string(),
86
+ project_id: z.coerce.string(),
86
87
  status: z.string(),
87
88
  ref: z.string(),
88
89
  sha: z.string(),
@@ -98,7 +99,7 @@ export const PaginationOptionsSchema = z.object({
98
99
  });
99
100
  // Schema for listing pipelines
100
101
  export const ListPipelinesSchema = z.object({
101
- project_id: z.string().describe("Project ID or URL-encoded path"),
102
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
102
103
  scope: z
103
104
  .enum(["running", "pending", "finished", "branches", "tags"])
104
105
  .optional()
@@ -121,7 +122,7 @@ export const ListPipelinesSchema = z.object({
121
122
  .describe("The status of pipelines"),
122
123
  ref: z.string().optional().describe("The ref of pipelines"),
123
124
  sha: z.string().optional().describe("The SHA of pipelines"),
124
- yaml_errors: z.boolean().optional().describe("Returns pipelines with invalid configurations"),
125
+ yaml_errors: flexibleBoolean.optional().describe("Returns pipelines with invalid configurations"),
125
126
  username: z.string().optional().describe("The username of the user who triggered pipelines"),
126
127
  updated_after: z
127
128
  .string()
@@ -139,22 +140,22 @@ export const ListPipelinesSchema = z.object({
139
140
  }).merge(PaginationOptionsSchema);
140
141
  // Schema for getting a specific pipeline
141
142
  export const GetPipelineSchema = z.object({
142
- project_id: z.string().describe("Project ID or URL-encoded path"),
143
- pipeline_id: z.string().or(z.number().describe("The ID of the pipeline")),
143
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
144
+ pipeline_id: z.coerce.string().describe("The ID of the pipeline"),
144
145
  });
145
146
  // Schema for listing jobs in a pipeline
146
147
  export const ListPipelineJobsSchema = z.object({
147
- project_id: z.string().describe("Project ID or URL-encoded path"),
148
- pipeline_id: z.string().or(z.number().describe("The ID of the pipeline")),
148
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
149
+ pipeline_id: z.coerce.string().describe("The ID of the pipeline"),
149
150
  scope: z
150
151
  .enum(["created", "pending", "running", "failed", "success", "canceled", "skipped", "manual"])
151
152
  .optional()
152
153
  .describe("The scope of jobs to show"),
153
- include_retried: z.boolean().optional().describe("Whether to include retried jobs"),
154
+ include_retried: flexibleBoolean.optional().describe("Whether to include retried jobs"),
154
155
  }).merge(PaginationOptionsSchema);
155
156
  // Schema for creating a new pipeline
156
157
  export const CreatePipelineSchema = z.object({
157
- project_id: z.string().describe("Project ID or URL-encoded path"),
158
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
158
159
  ref: z.string().describe("The branch or tag to run the pipeline on"),
159
160
  variables: z
160
161
  .array(z.object({
@@ -166,25 +167,22 @@ export const CreatePipelineSchema = z.object({
166
167
  });
167
168
  // Schema for retrying a pipeline
168
169
  export const RetryPipelineSchema = z.object({
169
- project_id: z.string().describe("Project ID or URL-encoded path"),
170
- pipeline_id: z.string().or(z.number().describe("The ID of the pipeline to retry")),
170
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
171
+ pipeline_id: z.coerce.string().describe("The ID of the pipeline to retry"),
171
172
  });
172
173
  // Schema for canceling a pipeline
173
- export const CancelPipelineSchema = z.object({
174
- project_id: z.string().describe("Project ID or URL-encoded path"),
175
- pipeline_id: z.string().or(z.number().describe("The ID of the pipeline to cancel")),
176
- });
174
+ export const CancelPipelineSchema = RetryPipelineSchema;
177
175
  // Schema for the input parameters for pipeline job operations
178
176
  export const GetPipelineJobOutputSchema = z.object({
179
- project_id: z.string().describe("Project ID or URL-encoded path"),
180
- job_id: z.string().or(z.number().describe("The ID of the job")),
177
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
178
+ job_id: z.coerce.string().describe("The ID of the job"),
181
179
  limit: z.number().optional().describe("Maximum number of lines to return from the end of the log (default: 1000)"),
182
180
  offset: z.number().optional().describe("Number of lines to skip from the end of the log (default: 0)"),
183
181
  });
184
182
  // User schemas
185
183
  export const GitLabUserSchema = z.object({
186
184
  username: z.string(), // Changed from login to match GitLab API
187
- id: z.string().or(z.number()),
185
+ id: z.coerce.string(),
188
186
  name: z.string(),
189
187
  avatar_url: z.string().nullable(),
190
188
  web_url: z.string(), // Changed from html_url to match GitLab API
@@ -193,7 +191,7 @@ export const GetUsersSchema = z.object({
193
191
  usernames: z.array(z.string()).describe("Array of usernames to search for"),
194
192
  });
195
193
  export const GitLabUsersResponseSchema = z.record(z.string(), z.object({
196
- id: z.string().or(z.number()),
194
+ id: z.coerce.string(),
197
195
  username: z.string(),
198
196
  name: z.string(),
199
197
  avatar_url: z.string().nullable(),
@@ -202,15 +200,15 @@ export const GitLabUsersResponseSchema = z.record(z.string(), z.object({
202
200
  // Namespace related schemas
203
201
  // Base schema for project-related operations
204
202
  const ProjectParamsSchema = z.object({
205
- project_id: z.string().describe("Project ID or complete URL-encoded path to project"), // Changed from owner/repo to match GitLab API
203
+ project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"), // Changed from owner/repo to match GitLab API
206
204
  });
207
205
  export const GitLabNamespaceSchema = z.object({
208
- id: z.string().or(z.number()),
206
+ id: z.coerce.string(),
209
207
  name: z.string(),
210
208
  path: z.string(),
211
209
  kind: z.enum(["user", "group"]),
212
210
  full_path: z.string(),
213
- parent_id: z.string().or(z.number().nullable()),
211
+ parent_id: z.coerce.string().nullable(),
214
212
  avatar_url: z.string().nullable(),
215
213
  web_url: z.string(),
216
214
  members_count_with_descendants: z.number().optional(),
@@ -220,32 +218,32 @@ export const GitLabNamespaceSchema = z.object({
220
218
  plan: z.string().optional(),
221
219
  end_date: z.string().nullable().optional(),
222
220
  trial_ends_on: z.string().nullable().optional(),
223
- trial: z.boolean().optional(),
221
+ trial: flexibleBoolean.optional(),
224
222
  root_repository_size: z.number().optional(),
225
223
  projects_count: z.number().optional(),
226
224
  });
227
225
  export const GitLabNamespaceExistsResponseSchema = z.object({
228
- exists: z.boolean(),
226
+ exists: flexibleBoolean,
229
227
  suggests: z.array(z.string()).optional(),
230
228
  });
231
229
  // Repository related schemas
232
230
  export const GitLabOwnerSchema = z.object({
233
231
  username: z.string(), // Changed from login to match GitLab API
234
- id: z.string().or(z.number()),
232
+ id: z.coerce.string(),
235
233
  avatar_url: z.string().nullable(),
236
234
  web_url: z.string(), // Changed from html_url to match GitLab API
237
235
  name: z.string(), // Added as GitLab includes full name
238
236
  state: z.string(), // Added as GitLab includes user state
239
237
  });
240
238
  export const GitLabRepositorySchema = z.object({
241
- id: z.string().or(z.number()),
239
+ id: z.coerce.string(),
242
240
  name: z.string(),
243
241
  path_with_namespace: z.string(),
244
242
  visibility: z.string().optional(),
245
243
  owner: GitLabOwnerSchema.optional(),
246
244
  web_url: z.string().optional(),
247
245
  description: z.string().nullable(),
248
- fork: z.boolean().optional(),
246
+ fork: flexibleBoolean.optional(),
249
247
  ssh_url_to_repo: z.string().optional(),
250
248
  http_url_to_repo: z.string().optional(),
251
249
  created_at: z.string().optional(),
@@ -253,7 +251,7 @@ export const GitLabRepositorySchema = z.object({
253
251
  default_branch: z.string().optional(),
254
252
  namespace: z
255
253
  .object({
256
- id: z.string().or(z.number()),
254
+ id: z.coerce.string(),
257
255
  name: z.string(),
258
256
  path: z.string(),
259
257
  kind: z.string(),
@@ -266,7 +264,7 @@ export const GitLabRepositorySchema = z.object({
266
264
  topics: z.array(z.string()).optional(),
267
265
  tag_list: z.array(z.string()).optional(), // deprecated but still present
268
266
  open_issues_count: z.number().optional(),
269
- archived: z.boolean().optional(),
267
+ archived: flexibleBoolean.optional(),
270
268
  forks_count: z.number().optional(),
271
269
  star_count: z.number().optional(),
272
270
  permissions: z
@@ -287,20 +285,20 @@ export const GitLabRepositorySchema = z.object({
287
285
  .nullable(),
288
286
  })
289
287
  .optional(),
290
- container_registry_enabled: z.boolean().optional(),
288
+ container_registry_enabled: flexibleBoolean.optional(),
291
289
  container_registry_access_level: z.string().optional(),
292
- issues_enabled: z.boolean().optional(),
293
- merge_requests_enabled: z.boolean().optional(),
290
+ issues_enabled: flexibleBoolean.optional(),
291
+ merge_requests_enabled: flexibleBoolean.optional(),
294
292
  merge_requests_template: z.string().nullable().optional(),
295
- wiki_enabled: z.boolean().optional(),
296
- jobs_enabled: z.boolean().optional(),
297
- snippets_enabled: z.boolean().optional(),
298
- can_create_merge_request_in: z.boolean().optional(),
299
- resolve_outdated_diff_discussions: z.boolean().nullable().optional(),
300
- shared_runners_enabled: z.boolean().optional(),
293
+ wiki_enabled: flexibleBoolean.optional(),
294
+ jobs_enabled: flexibleBoolean.optional(),
295
+ snippets_enabled: flexibleBoolean.optional(),
296
+ can_create_merge_request_in: flexibleBoolean.optional(),
297
+ resolve_outdated_diff_discussions: flexibleBoolean.nullable().optional(),
298
+ shared_runners_enabled: flexibleBoolean.optional(),
301
299
  shared_with_groups: z
302
300
  .array(z.object({
303
- group_id: z.string().or(z.number()),
301
+ group_id: z.coerce.string(),
304
302
  group_name: z.string(),
305
303
  group_full_path: z.string(),
306
304
  group_access_level: z.number(),
@@ -321,7 +319,7 @@ export const GitLabFileContentSchema = z.object({
321
319
  blob_id: z.string(), // Added to match GitLab API
322
320
  commit_id: z.string(), // ID of the current file version
323
321
  last_commit_id: z.string(), // Added to match GitLab API
324
- execute_filemode: z.boolean().optional(), // Added to match GitLab API
322
+ execute_filemode: flexibleBoolean.optional(), // Added to match GitLab API
325
323
  });
326
324
  export const GitLabDirectoryContentSchema = z.object({
327
325
  name: z.string(),
@@ -349,13 +347,13 @@ export const GitLabTreeItemSchema = z.object({
349
347
  mode: z.string(),
350
348
  });
351
349
  export const GetRepositoryTreeSchema = z.object({
352
- project_id: z.string().describe("The ID or URL-encoded path of the project"),
350
+ project_id: z.coerce.string().describe("The ID or URL-encoded path of the project"),
353
351
  path: z.string().optional().describe("The path inside the repository"),
354
352
  ref: z
355
353
  .string()
356
354
  .optional()
357
355
  .describe("The name of a repository branch or tag. Defaults to the default branch."),
358
- recursive: z.boolean().optional().describe("Boolean value to get a recursive tree"),
356
+ recursive: flexibleBoolean.optional().describe("Boolean value to get a recursive tree"),
359
357
  per_page: z.number().optional().describe("Number of results to show per page"),
360
358
  page_token: z.string().optional().describe("The tree record ID for pagination"),
361
359
  pagination: z.string().optional().describe("Pagination method (keyset)"),
@@ -396,9 +394,9 @@ export const GitLabReferenceSchema = z.object({
396
394
  });
397
395
  // Milestones rest api output schemas
398
396
  export const GitLabMilestonesSchema = z.object({
399
- id: z.string().or(z.number()),
400
- iid: z.string().or(z.number()),
401
- project_id: z.string().or(z.number()),
397
+ id: z.coerce.string(),
398
+ iid: z.coerce.string(),
399
+ project_id: z.coerce.string(),
402
400
  title: z.string(),
403
401
  description: z.string().nullable(),
404
402
  due_date: z.string().nullable(),
@@ -406,7 +404,7 @@ export const GitLabMilestonesSchema = z.object({
406
404
  state: z.string(),
407
405
  updated_at: z.string(),
408
406
  created_at: z.string(),
409
- expired: z.boolean(),
407
+ expired: flexibleBoolean,
410
408
  web_url: z.string().optional(),
411
409
  });
412
410
  // Input schemas for operations
@@ -414,13 +412,13 @@ export const CreateRepositoryOptionsSchema = z.object({
414
412
  name: z.string(),
415
413
  description: z.string().optional(),
416
414
  visibility: z.enum(["private", "internal", "public"]).optional(), // Changed from private to match GitLab API
417
- initialize_with_readme: z.boolean().optional(), // Changed from auto_init to match GitLab API
415
+ initialize_with_readme: flexibleBoolean.optional(), // Changed from auto_init to match GitLab API
418
416
  });
419
417
  export const CreateIssueOptionsSchema = z.object({
420
418
  title: z.string(),
421
419
  description: z.string().optional(), // Changed from body to match GitLab API
422
420
  assignee_ids: z.array(z.number()).optional(), // Changed from assignees to match GitLab API
423
- milestone_id: z.string().or(z.number().optional()), // Changed from milestone to match GitLab API
421
+ milestone_id: z.coerce.string().optional(), // Changed from milestone to match GitLab API
424
422
  labels: z.array(z.string()).optional(),
425
423
  });
426
424
  export const GitLabDiffSchema = z.object({
@@ -429,9 +427,9 @@ export const GitLabDiffSchema = z.object({
429
427
  a_mode: z.string(),
430
428
  b_mode: z.string(),
431
429
  diff: z.string(),
432
- new_file: z.boolean(),
433
- renamed_file: z.boolean(),
434
- deleted_file: z.boolean(),
430
+ new_file: flexibleBoolean,
431
+ renamed_file: flexibleBoolean,
432
+ deleted_file: flexibleBoolean,
435
433
  });
436
434
  // Response schemas for operations
437
435
  export const GitLabCreateUpdateFileResponseSchema = z.object({
@@ -462,12 +460,12 @@ export const GitLabCompareResultSchema = z.object({
462
460
  }).optional(),
463
461
  commits: z.array(GitLabCommitSchema),
464
462
  diffs: z.array(GitLabDiffSchema),
465
- compare_timeout: z.boolean().optional(),
466
- compare_same_ref: z.boolean().optional(),
463
+ compare_timeout: flexibleBoolean.optional(),
464
+ compare_same_ref: flexibleBoolean.optional(),
467
465
  });
468
466
  // Issue related schemas
469
467
  export const GitLabLabelSchema = z.object({
470
- id: z.string().or(z.number()),
468
+ id: z.coerce.string(),
471
469
  name: z.string(),
472
470
  color: z.string(),
473
471
  text_color: z.string(),
@@ -476,22 +474,22 @@ export const GitLabLabelSchema = z.object({
476
474
  open_issues_count: z.number().optional(),
477
475
  closed_issues_count: z.number().optional(),
478
476
  open_merge_requests_count: z.number().optional(),
479
- subscribed: z.boolean().optional(),
477
+ subscribed: flexibleBoolean.optional(),
480
478
  priority: z.number().nullable().optional(),
481
- is_project_label: z.boolean().optional(),
479
+ is_project_label: flexibleBoolean.optional(),
482
480
  });
483
481
  export const GitLabMilestoneSchema = z.object({
484
- id: z.string().or(z.number()),
485
- iid: z.string().or(z.number()), // Added to match GitLab API
482
+ id: z.coerce.string(),
483
+ iid: z.coerce.string(), // Added to match GitLab API
486
484
  title: z.string(),
487
485
  description: z.string().nullable().default(""),
488
486
  state: z.string(),
489
487
  web_url: z.string(), // Changed from html_url to match GitLab API
490
488
  });
491
489
  export const GitLabIssueSchema = z.object({
492
- id: z.string().or(z.number()),
493
- iid: z.string().or(z.number()), // Added to match GitLab API
494
- project_id: z.string().or(z.number()), // Added to match GitLab API
490
+ id: z.coerce.string(),
491
+ iid: z.coerce.string(), // Added to match GitLab API
492
+ project_id: z.coerce.string(), // Added to match GitLab API
495
493
  title: z.string(),
496
494
  description: z.string().nullable().default(""), // Changed from body to match GitLab API
497
495
  state: z.string(),
@@ -518,14 +516,14 @@ export const GitLabIssueSchema = z.object({
518
516
  human_total_time_spent: z.string().nullable(),
519
517
  })
520
518
  .optional(),
521
- confidential: z.boolean().optional(),
519
+ confidential: flexibleBoolean.optional(),
522
520
  due_date: z.string().nullable().optional(),
523
- discussion_locked: z.boolean().nullable().optional(),
521
+ discussion_locked: flexibleBoolean.nullable().optional(),
524
522
  weight: z.number().nullable().optional(),
525
523
  });
526
524
  // NEW SCHEMA: For issue with link details (used in listing issue links)
527
525
  export const GitLabIssueWithLinkDetailsSchema = GitLabIssueSchema.extend({
528
- issue_link_id: z.string().or(z.number()),
526
+ issue_link_id: z.coerce.string(),
529
527
  link_type: z.enum(["relates_to", "blocks", "is_blocked_by"]),
530
528
  link_created_at: z.string(),
531
529
  link_updated_at: z.string(),
@@ -537,7 +535,7 @@ export const GitLabForkParentSchema = z.object({
537
535
  owner: z
538
536
  .object({
539
537
  username: z.string(), // Changed from login to match GitLab API
540
- id: z.string().or(z.number()),
538
+ id: z.coerce.string(),
541
539
  avatar_url: z.string().nullable(),
542
540
  })
543
541
  .optional(), // Made optional to handle cases where GitLab API doesn't include it
@@ -553,14 +551,14 @@ export const GitLabMergeRequestDiffRefSchema = z.object({
553
551
  start_sha: z.string(),
554
552
  });
555
553
  export const GitLabMergeRequestSchema = z.object({
556
- id: z.string().or(z.number()),
557
- iid: z.string().or(z.number()),
558
- project_id: z.string().or(z.number()),
554
+ id: z.coerce.string(),
555
+ iid: z.coerce.string(),
556
+ project_id: z.coerce.string(),
559
557
  title: z.string(),
560
558
  description: z.string().nullable(),
561
559
  state: z.string(),
562
- merged: z.boolean().optional(),
563
- draft: z.boolean().optional(),
560
+ merged: flexibleBoolean.optional(),
561
+ draft: flexibleBoolean.optional(),
564
562
  author: GitLabUserSchema,
565
563
  assignees: z.array(GitLabUserSchema).optional(),
566
564
  reviewers: z.array(GitLabUserSchema).optional(),
@@ -576,15 +574,15 @@ export const GitLabMergeRequestSchema = z.object({
576
574
  detailed_merge_status: z.string().optional(),
577
575
  merge_status: z.string().optional(),
578
576
  merge_error: z.string().nullable().optional(),
579
- work_in_progress: z.boolean().optional(),
580
- blocking_discussions_resolved: z.boolean().optional(),
581
- should_remove_source_branch: z.boolean().nullable().optional(),
582
- force_remove_source_branch: z.boolean().nullable().optional(),
583
- allow_collaboration: z.boolean().optional(),
584
- allow_maintainer_to_push: z.boolean().optional(),
577
+ work_in_progress: flexibleBoolean.optional(),
578
+ blocking_discussions_resolved: flexibleBoolean.optional(),
579
+ should_remove_source_branch: flexibleBoolean.nullable().optional(),
580
+ force_remove_source_branch: flexibleBoolean.nullable().optional(),
581
+ allow_collaboration: flexibleBoolean.optional(),
582
+ allow_maintainer_to_push: flexibleBoolean.optional(),
585
583
  changes_count: z.string().nullable().optional(),
586
- merge_when_pipeline_succeeds: z.boolean().optional(),
587
- squash: z.boolean().optional(),
584
+ merge_when_pipeline_succeeds: flexibleBoolean.optional(),
585
+ squash: flexibleBoolean.optional(),
588
586
  labels: z.array(z.string()).optional(),
589
587
  });
590
588
  export const LineRangeSchema = z.object({
@@ -603,20 +601,20 @@ export const LineRangeSchema = z.object({
603
601
  }).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.");
604
602
  // Discussion related schemas
605
603
  export const GitLabDiscussionNoteSchema = z.object({
606
- id: z.string().or(z.number()),
604
+ id: z.coerce.string(),
607
605
  type: z.enum(["DiscussionNote", "DiffNote", "Note"]).nullable(), // Allow null type for regular notes
608
606
  body: z.string(),
609
607
  attachment: z.any().nullable(), // Can be string or object, handle appropriately
610
608
  author: GitLabUserSchema,
611
609
  created_at: z.string(),
612
610
  updated_at: z.string(),
613
- system: z.boolean(),
614
- noteable_id: z.string().or(z.number()),
611
+ system: flexibleBoolean,
612
+ noteable_id: z.coerce.string(),
615
613
  noteable_type: z.enum(["Issue", "MergeRequest", "Snippet", "Commit", "Epic"]),
616
- project_id: z.string().or(z.number().optional()), // Optional for group-level discussions like Epics
617
- noteable_iid: z.coerce.number().nullable(),
618
- resolvable: z.boolean().optional(),
619
- resolved: z.boolean().optional(),
614
+ project_id: z.coerce.string().optional(),
615
+ noteable_iid: z.coerce.string().nullable().optional(),
616
+ resolvable: flexibleBoolean.optional(),
617
+ resolved: flexibleBoolean.optional(),
620
618
  resolved_by: GitLabUserSchema.nullable().optional(),
621
619
  resolved_at: z.string().nullable().optional(),
622
620
  position: z
@@ -654,8 +652,8 @@ export const PaginatedResponseSchema = z.object({
654
652
  pagination: GitLabPaginationSchema.optional(),
655
653
  });
656
654
  export const GitLabDiscussionSchema = z.object({
657
- id: z.string(),
658
- individual_note: z.boolean(),
655
+ id: z.coerce.string(),
656
+ individual_note: flexibleBoolean,
659
657
  notes: z.array(GitLabDiscussionNoteSchema),
660
658
  });
661
659
  // Create a schema for paginated discussions response
@@ -664,20 +662,20 @@ export const PaginatedDiscussionsResponseSchema = z.object({
664
662
  pagination: GitLabPaginationSchema,
665
663
  });
666
664
  export const ListIssueDiscussionsSchema = z.object({
667
- project_id: z.string().describe("Project ID or URL-encoded path"),
668
- issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
665
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
666
+ issue_iid: z.coerce.string().describe("The internal ID of the project issue"),
669
667
  }).merge(PaginationOptionsSchema);
670
668
  // Input schema for listing merge request discussions
671
669
  export const ListMergeRequestDiscussionsSchema = ProjectParamsSchema.extend({
672
- merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
670
+ merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
673
671
  }).merge(PaginationOptionsSchema);
674
672
  // Input schema for updating a merge request discussion note
675
673
  export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
676
- merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
677
- discussion_id: z.string().describe("The ID of a thread"),
678
- note_id: z.string().or(z.number().describe("The ID of a thread note")),
674
+ merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
675
+ discussion_id: z.coerce.string().describe("The ID of a thread"),
676
+ note_id: z.coerce.string().describe("The ID of a thread note"),
679
677
  body: z.string().optional().describe("The content of the note or reply"),
680
- resolved: z.boolean().optional().describe("Resolve or unresolve the note"),
678
+ resolved: flexibleBoolean.optional().describe("Resolve or unresolve the note"),
681
679
  })
682
680
  .refine(data => data.body !== undefined || data.resolved !== undefined, {
683
681
  message: "At least one of 'body' or 'resolved' must be provided",
@@ -687,22 +685,22 @@ export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
687
685
  });
688
686
  // Input schema for adding a note to an existing merge request discussion
689
687
  export const CreateMergeRequestNoteSchema = ProjectParamsSchema.extend({
690
- merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
691
- discussion_id: z.string().describe("The ID of a thread"),
688
+ merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
689
+ discussion_id: z.coerce.string().describe("The ID of a thread"),
692
690
  body: z.string().describe("The content of the note or reply"),
693
691
  created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
694
692
  });
695
693
  // Input schema for updating an issue discussion note
696
694
  export const UpdateIssueNoteSchema = ProjectParamsSchema.extend({
697
- issue_iid: z.string().or(z.number().describe("The IID of an issue")),
698
- discussion_id: z.string().describe("The ID of a thread"),
699
- note_id: z.string().or(z.number().describe("The ID of a thread note")),
695
+ issue_iid: z.coerce.string().describe("The IID of an issue"),
696
+ discussion_id: z.coerce.string().describe("The ID of a thread"),
697
+ note_id: z.coerce.string().describe("The ID of a thread note"),
700
698
  body: z.string().describe("The content of the note or reply"),
701
699
  });
702
700
  // Input schema for adding a note to an existing issue discussion
703
701
  export const CreateIssueNoteSchema = ProjectParamsSchema.extend({
704
- issue_iid: z.string().or(z.number().describe("The IID of an issue")),
705
- discussion_id: z.string().describe("The ID of a thread"),
702
+ issue_iid: z.coerce.string().describe("The IID of an issue"),
703
+ discussion_id: z.coerce.string().describe("The ID of a thread"),
706
704
  body: z.string().describe("The content of the note or reply"),
707
705
  created_at: z.string().optional().describe("Date the note was created at (ISO 8601 format)"),
708
706
  });
@@ -726,7 +724,7 @@ export const CreateRepositorySchema = z.object({
726
724
  .enum(["private", "internal", "public"])
727
725
  .optional()
728
726
  .describe("Repository visibility level"),
729
- initialize_with_readme: z.boolean().optional().describe("Initialize with README.md"),
727
+ initialize_with_readme: flexibleBoolean.optional().describe("Initialize with README.md"),
730
728
  });
731
729
  export const GetFileContentsSchema = ProjectParamsSchema.extend({
732
730
  file_path: z.string().describe("Path to the file or directory"),
@@ -747,7 +745,7 @@ export const CreateIssueSchema = ProjectParamsSchema.extend({
747
745
  description: z.string().optional().describe("Issue description"),
748
746
  assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign"),
749
747
  labels: z.array(z.string()).optional().describe("Array of label names"),
750
- milestone_id: z.string().or(z.number().optional().describe("Milestone ID to assign")),
748
+ milestone_id: z.coerce.string().optional().describe("Milestone ID to assign"),
751
749
  });
752
750
  const MergeRequestOptionsSchema = {
753
751
  title: z.string().describe("Merge request title"),
@@ -763,13 +761,13 @@ const MergeRequestOptionsSchema = {
763
761
  .optional()
764
762
  .describe("The ID of the users to assign as reviewers of the MR"),
765
763
  labels: z.array(z.string()).optional().describe("Labels for the MR"),
766
- draft: z.boolean().optional().describe("Create as draft merge request"),
764
+ draft: flexibleBoolean.optional().describe("Create as draft merge request"),
767
765
  allow_collaboration: z
768
766
  .boolean()
769
767
  .optional()
770
768
  .describe("Allow commits from upstream members"),
771
- remove_source_branch: z.boolean().optional().nullable().describe("Flag indicating if a merge request should remove the source branch when merging."),
772
- squash: z.boolean().optional().nullable().describe("If true, squash all commits into a single commit on merge."),
769
+ remove_source_branch: flexibleBoolean.optional().nullable().describe("Flag indicating if a merge request should remove the source branch when merging."),
770
+ squash: flexibleBoolean.optional().nullable().describe("If true, squash all commits into a single commit on merge."),
773
771
  };
774
772
  export const CreateMergeRequestOptionsSchema = z.object(MergeRequestOptionsSchema);
775
773
  export const CreateMergeRequestSchema = ProjectParamsSchema.extend(MergeRequestOptionsSchema);
@@ -784,11 +782,11 @@ export const CreateBranchSchema = ProjectParamsSchema.extend({
784
782
  export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
785
783
  from: z.string().describe("The base branch or commit SHA to compare from"),
786
784
  to: z.string().describe("The target branch or commit SHA to compare to"),
787
- straight: z.boolean().optional().describe("Comparison method: false for '...' (default), true for '--'"),
785
+ straight: flexibleBoolean.optional().describe("Comparison method: false for '...' (default), true for '--'"),
788
786
  excluded_file_patterns: z.array(z.string()).optional().describe("Array of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: [\"^test/mocks/\", \"\\.spec\\.ts$\", \"package-lock\\.json\"]"),
789
787
  });
790
788
  export const GetMergeRequestSchema = ProjectParamsSchema.extend({
791
- merge_request_iid: z.string().or(z.number().optional().describe("The IID of a merge request")),
789
+ merge_request_iid: z.coerce.string().optional().describe("The IID of a merge request"),
792
790
  source_branch: z.string().optional().describe("Source branch name"),
793
791
  });
794
792
  export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
@@ -812,8 +810,8 @@ export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
812
810
  .boolean()
813
811
  .optional()
814
812
  .describe("Flag indicating if the source branch should be removed"),
815
- squash: z.boolean().optional().describe("Squash commits into a single commit when merging"),
816
- draft: z.boolean().optional().describe("Work in progress merge request"),
813
+ squash: flexibleBoolean.optional().describe("Squash commits into a single commit when merging"),
814
+ draft: flexibleBoolean.optional().describe("Work in progress merge request"),
817
815
  });
818
816
  export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
819
817
  view: z.enum(["inline", "parallel"]).optional().describe("Diff view type"),
@@ -821,24 +819,24 @@ export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
821
819
  export const ListMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
822
820
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
823
821
  per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
824
- unidiff: z.boolean().optional().describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
822
+ unidiff: flexibleBoolean.optional().describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
825
823
  });
826
824
  export const CreateNoteSchema = z.object({
827
- project_id: z.string().describe("Project ID or namespace/project_path"),
825
+ project_id: z.coerce.string().describe("Project ID or namespace/project_path"),
828
826
  noteable_type: z
829
827
  .enum(["issue", "merge_request"])
830
828
  .describe("Type of noteable (issue or merge_request)"),
831
- noteable_iid: z.coerce.number().describe("IID of the issue or merge request"),
829
+ noteable_iid: z.coerce.string().describe("IID of the issue or merge request"),
832
830
  body: z.string().describe("Note content"),
833
831
  });
834
832
  // Issues API operation schemas
835
833
  export const ListIssuesSchema = z.object({
836
- project_id: z.string().describe("Project ID or URL-encoded path"),
837
- assignee_id: z.string().or(z.number().optional().describe("Return issues assigned to the given user ID")),
834
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
835
+ assignee_id: z.coerce.string().optional().describe("Return issues assigned to the given user ID. user id or none or any"),
838
836
  assignee_username: z.array(z.string()).optional().describe("Return issues assigned to the given username"),
839
- author_id: z.string().or(z.number().optional().describe("Return issues created by the given user ID")),
837
+ author_id: z.coerce.string().optional().describe("Return issues created by the given user ID"),
840
838
  author_username: z.string().optional().describe("Return issues created by the given username"),
841
- confidential: z.boolean().optional().describe("Filter confidential or public issues"),
839
+ confidential: flexibleBoolean.optional().describe("Filter confidential or public issues"),
842
840
  created_after: z.string().optional().describe("Return issues created after the given time"),
843
841
  created_before: z.string().optional().describe("Return issues created before the given time"),
844
842
  due_date: z.string().optional().describe("Return issues that have the due date"),
@@ -855,28 +853,24 @@ export const ListIssuesSchema = z.object({
855
853
  .describe("Return issues with a specific state"),
856
854
  updated_after: z.string().optional().describe("Return issues updated after the given time"),
857
855
  updated_before: z.string().optional().describe("Return issues updated before the given time"),
858
- with_labels_details: z.boolean().optional().describe("Return more details for each label"),
856
+ with_labels_details: flexibleBoolean.optional().describe("Return more details for each label"),
859
857
  }).merge(PaginationOptionsSchema);
860
858
  // Merge Requests API operation schemas
861
859
  export const ListMergeRequestsSchema = z.object({
862
- project_id: z.string().describe("Project ID or URL-encoded path"),
863
- assignee_id: z
864
- .number()
865
- .optional()
866
- .describe("Returns merge requests assigned to the given user ID"),
860
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
861
+ assignee_id: z.coerce.string().optional().describe("Return issues assigned to the given user ID. user id or none or any"),
867
862
  assignee_username: z
868
863
  .string()
869
864
  .optional()
870
865
  .describe("Returns merge requests assigned to the given username"),
871
- author_id: z.string().or(z.number().optional().describe("Returns merge requests created by the given user ID")),
866
+ author_id: z.coerce.string().optional().describe("Returns merge requests created by the given user ID"),
872
867
  author_username: z
873
868
  .string()
874
869
  .optional()
875
870
  .describe("Returns merge requests created by the given username"),
876
- reviewer_id: z
877
- .number()
871
+ reviewer_id: z.coerce.string()
878
872
  .optional()
879
- .describe("Returns merge requests which have the user as a reviewer"),
873
+ .describe("Returns merge requests which have the user as a reviewer. user id or none or any"),
880
874
  reviewer_username: z
881
875
  .string()
882
876
  .optional()
@@ -925,29 +919,29 @@ export const ListMergeRequestsSchema = z.object({
925
919
  .optional()
926
920
  .describe("Return merge requests from a specific source branch"),
927
921
  wip: z.enum(["yes", "no"]).optional().describe("Filter merge requests against their wip status"),
928
- with_labels_details: z.boolean().optional().describe("Return more details for each label"),
922
+ with_labels_details: flexibleBoolean.optional().describe("Return more details for each label"),
929
923
  }).merge(PaginationOptionsSchema);
930
924
  export const GetIssueSchema = z.object({
931
- project_id: z.string().describe("Project ID or URL-encoded path"),
932
- issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
925
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
926
+ issue_iid: z.coerce.string().describe("The internal ID of the project issue"),
933
927
  });
934
928
  export const UpdateIssueSchema = z.object({
935
- project_id: z.string().describe("Project ID or URL-encoded path"),
936
- issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
929
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
930
+ issue_iid: z.coerce.string().describe("The internal ID of the project issue"),
937
931
  title: z.string().optional().describe("The title of the issue"),
938
932
  description: z.string().optional().describe("The description of the issue"),
939
933
  assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign issue to"),
940
- confidential: z.boolean().optional().describe("Set the issue to be confidential"),
941
- discussion_locked: z.boolean().optional().describe("Flag to lock discussions"),
934
+ confidential: flexibleBoolean.optional().describe("Set the issue to be confidential"),
935
+ discussion_locked: flexibleBoolean.optional().describe("Flag to lock discussions"),
942
936
  due_date: z.string().optional().describe("Date the issue is due (YYYY-MM-DD)"),
943
937
  labels: z.array(z.string()).optional().describe("Array of label names"),
944
- milestone_id: z.string().or(z.number().optional().describe("Milestone ID to assign")),
938
+ milestone_id: z.coerce.string().optional().describe("Milestone ID to assign"),
945
939
  state_event: z.enum(["close", "reopen"]).optional().describe("Update issue state (close/reopen)"),
946
940
  weight: z.number().optional().describe("Weight of the issue (0-9)"),
947
941
  });
948
942
  export const DeleteIssueSchema = z.object({
949
- project_id: z.string().describe("Project ID or URL-encoded path"),
950
- issue_iid: z.string().or(z.number().describe("The internal ID of the project issue")),
943
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
944
+ issue_iid: z.coerce.string().describe("The internal ID of the project issue"),
951
945
  });
952
946
  // Issue links related schemas
953
947
  export const GitLabIssueLinkSchema = z.object({
@@ -956,51 +950,51 @@ export const GitLabIssueLinkSchema = z.object({
956
950
  link_type: z.enum(["relates_to", "blocks", "is_blocked_by"]),
957
951
  });
958
952
  export const ListIssueLinksSchema = z.object({
959
- project_id: z.string().describe("Project ID or URL-encoded path"),
960
- issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
953
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
954
+ issue_iid: z.coerce.string().describe("The internal ID of a project's issue"),
961
955
  });
962
956
  export const GetIssueLinkSchema = z.object({
963
- project_id: z.string().describe("Project ID or URL-encoded path"),
964
- issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
965
- issue_link_id: z.string().or(z.number().describe("ID of an issue relationship")),
957
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
958
+ issue_iid: z.coerce.string().describe("The internal ID of a project's issue"),
959
+ issue_link_id: z.coerce.string().describe("ID of an issue relationship"),
966
960
  });
967
961
  export const CreateIssueLinkSchema = z.object({
968
- project_id: z.string().describe("Project ID or URL-encoded path"),
969
- issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
970
- target_project_id: z.string().describe("The ID or URL-encoded path of a target project"),
971
- target_issue_iid: z.string().or(z.number().describe("The internal ID of a target project's issue")),
962
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
963
+ issue_iid: z.coerce.string().describe("The internal ID of a project's issue"),
964
+ target_project_id: z.coerce.string().describe("The ID or URL-encoded path of a target project"),
965
+ target_issue_iid: z.coerce.string().describe("The internal ID of a target project's issue"),
972
966
  link_type: z
973
967
  .enum(["relates_to", "blocks", "is_blocked_by"])
974
968
  .optional()
975
969
  .describe("The type of the relation, defaults to relates_to"),
976
970
  });
977
971
  export const DeleteIssueLinkSchema = z.object({
978
- project_id: z.string().describe("Project ID or URL-encoded path"),
979
- issue_iid: z.string().or(z.number().describe("The internal ID of a project's issue")),
980
- issue_link_id: z.string().or(z.number().describe("The ID of an issue relationship")),
972
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
973
+ issue_iid: z.coerce.string().describe("The internal ID of a project's issue"),
974
+ issue_link_id: z.coerce.string().describe("The ID of an issue relationship"),
981
975
  });
982
976
  // Namespace API operation schemas
983
977
  export const ListNamespacesSchema = z.object({
984
978
  search: z.string().optional().describe("Search term for namespaces"),
985
- owned: z.boolean().optional().describe("Filter for namespaces owned by current user"),
979
+ owned: flexibleBoolean.optional().describe("Filter for namespaces owned by current user"),
986
980
  }).merge(PaginationOptionsSchema);
987
981
  export const GetNamespaceSchema = z.object({
988
- namespace_id: z.string().describe("Namespace ID or full path"),
982
+ namespace_id: z.coerce.string().describe("Namespace ID or full path"),
989
983
  });
990
984
  export const VerifyNamespaceSchema = z.object({
991
985
  path: z.string().describe("Namespace path to verify"),
992
986
  });
993
987
  // Project API operation schemas
994
988
  export const GetProjectSchema = z.object({
995
- project_id: z.string().describe("Project ID or URL-encoded path"),
989
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
996
990
  });
997
991
  export const ListProjectsSchema = z.object({
998
992
  search: z.string().optional().describe("Search term for projects"),
999
- search_namespaces: z.boolean().optional().describe("Needs to be true if search is full path"),
1000
- owned: z.boolean().optional().describe("Filter for projects owned by current user"),
1001
- membership: z.boolean().optional().describe("Filter for projects where current user is a member"),
1002
- simple: z.boolean().optional().describe("Return only limited fields"),
1003
- archived: z.boolean().optional().describe("Filter for archived projects"),
993
+ search_namespaces: flexibleBoolean.optional().describe("Needs to be true if search is full path"),
994
+ owned: flexibleBoolean.optional().describe("Filter for projects owned by current user"),
995
+ membership: flexibleBoolean.optional().describe("Filter for projects where current user is a member"),
996
+ simple: flexibleBoolean.optional().describe("Return only limited fields"),
997
+ archived: flexibleBoolean.optional().describe("Filter for archived projects"),
1004
998
  visibility: z
1005
999
  .enum(["public", "internal", "private"])
1006
1000
  .optional()
@@ -1025,21 +1019,21 @@ export const ListProjectsSchema = z.object({
1025
1019
  }).merge(PaginationOptionsSchema);
1026
1020
  // Label operation schemas
1027
1021
  export const ListLabelsSchema = z.object({
1028
- project_id: z.string().describe("Project ID or URL-encoded path"),
1022
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1029
1023
  with_counts: z
1030
1024
  .boolean()
1031
1025
  .optional()
1032
1026
  .describe("Whether or not to include issue and merge request counts"),
1033
- include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
1027
+ include_ancestor_groups: flexibleBoolean.optional().describe("Include ancestor groups"),
1034
1028
  search: z.string().optional().describe("Keyword to filter labels by"),
1035
1029
  });
1036
1030
  export const GetLabelSchema = z.object({
1037
- project_id: z.string().describe("Project ID or URL-encoded path"),
1038
- label_id: z.string().describe("The ID or title of a project's label"),
1039
- include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
1031
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1032
+ label_id: z.coerce.string().describe("The ID or title of a project's label"),
1033
+ include_ancestor_groups: flexibleBoolean.optional().describe("Include ancestor groups"),
1040
1034
  });
1041
1035
  export const CreateLabelSchema = z.object({
1042
- project_id: z.string().describe("Project ID or URL-encoded path"),
1036
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1043
1037
  name: z.string().describe("The name of the label"),
1044
1038
  color: z
1045
1039
  .string()
@@ -1048,8 +1042,8 @@ export const CreateLabelSchema = z.object({
1048
1042
  priority: z.number().nullable().optional().describe("The priority of the label"),
1049
1043
  });
1050
1044
  export const UpdateLabelSchema = z.object({
1051
- project_id: z.string().describe("Project ID or URL-encoded path"),
1052
- label_id: z.string().describe("The ID or title of a project's label"),
1045
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1046
+ label_id: z.coerce.string().describe("The ID or title of a project's label"),
1053
1047
  new_name: z.string().optional().describe("The new name of the label"),
1054
1048
  color: z
1055
1049
  .string()
@@ -1059,20 +1053,20 @@ export const UpdateLabelSchema = z.object({
1059
1053
  priority: z.number().nullable().optional().describe("The new priority of the label"),
1060
1054
  });
1061
1055
  export const DeleteLabelSchema = z.object({
1062
- project_id: z.string().describe("Project ID or URL-encoded path"),
1063
- label_id: z.string().describe("The ID or title of a project's label"),
1056
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1057
+ label_id: z.coerce.string().describe("The ID or title of a project's label"),
1064
1058
  });
1065
1059
  // Group projects schema
1066
1060
  export const ListGroupProjectsSchema = z.object({
1067
- group_id: z.string().describe("Group ID or path"),
1068
- include_subgroups: z.boolean().optional().describe("Include projects from subgroups"),
1061
+ group_id: z.coerce.string().describe("Group ID or path"),
1062
+ include_subgroups: flexibleBoolean.optional().describe("Include projects from subgroups"),
1069
1063
  search: z.string().optional().describe("Search term to filter projects"),
1070
1064
  order_by: z
1071
1065
  .enum(["name", "path", "created_at", "updated_at", "last_activity_at"])
1072
1066
  .optional()
1073
1067
  .describe("Field to sort by"),
1074
1068
  sort: z.enum(["asc", "desc"]).optional().describe("Sort direction"),
1075
- archived: z.boolean().optional().describe("Filter for archived projects"),
1069
+ archived: flexibleBoolean.optional().describe("Filter for archived projects"),
1076
1070
  visibility: z
1077
1071
  .enum(["public", "internal", "private"])
1078
1072
  .optional()
@@ -1087,35 +1081,35 @@ export const ListGroupProjectsSchema = z.object({
1087
1081
  .describe("Filter projects with merge requests feature enabled"),
1088
1082
  min_access_level: z.number().optional().describe("Filter by minimum access level"),
1089
1083
  with_programming_language: z.string().optional().describe("Filter by programming language"),
1090
- starred: z.boolean().optional().describe("Filter by starred projects"),
1091
- statistics: z.boolean().optional().describe("Include project statistics"),
1092
- with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
1093
- with_security_reports: z.boolean().optional().describe("Include security reports"),
1084
+ starred: flexibleBoolean.optional().describe("Filter by starred projects"),
1085
+ statistics: flexibleBoolean.optional().describe("Include project statistics"),
1086
+ with_custom_attributes: flexibleBoolean.optional().describe("Include custom attributes"),
1087
+ with_security_reports: flexibleBoolean.optional().describe("Include security reports"),
1094
1088
  }).merge(PaginationOptionsSchema);
1095
1089
  // Add wiki operation schemas
1096
1090
  export const ListWikiPagesSchema = z.object({
1097
- project_id: z.string().describe("Project ID or URL-encoded path"),
1098
- with_content: z.boolean().optional().describe("Include content of the wiki pages"),
1091
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1092
+ with_content: flexibleBoolean.optional().describe("Include content of the wiki pages"),
1099
1093
  }).merge(PaginationOptionsSchema);
1100
1094
  export const GetWikiPageSchema = z.object({
1101
- project_id: z.string().describe("Project ID or URL-encoded path"),
1095
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1102
1096
  slug: z.string().describe("URL-encoded slug of the wiki page"),
1103
1097
  });
1104
1098
  export const CreateWikiPageSchema = z.object({
1105
- project_id: z.string().describe("Project ID or URL-encoded path"),
1099
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1106
1100
  title: z.string().describe("Title of the wiki page"),
1107
1101
  content: z.string().describe("Content of the wiki page"),
1108
1102
  format: z.string().optional().describe("Content format, e.g., markdown, rdoc"),
1109
1103
  });
1110
1104
  export const UpdateWikiPageSchema = z.object({
1111
- project_id: z.string().describe("Project ID or URL-encoded path"),
1105
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1112
1106
  slug: z.string().describe("URL-encoded slug of the wiki page"),
1113
1107
  title: z.string().optional().describe("New title of the wiki page"),
1114
1108
  content: z.string().optional().describe("New content of the wiki page"),
1115
1109
  format: z.string().optional().describe("Content format, e.g., markdown, rdoc"),
1116
1110
  });
1117
1111
  export const DeleteWikiPageSchema = z.object({
1118
- project_id: z.string().describe("Project ID or URL-encoded path"),
1112
+ project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
1119
1113
  slug: z.string().describe("URL-encoded slug of the wiki page"),
1120
1114
  });
1121
1115
  // Define wiki response schemas
@@ -1145,7 +1139,7 @@ export const MergeRequestThreadPositionSchema = z.object({
1145
1139
  });
1146
1140
  // Schema for creating a new merge request thread
1147
1141
  export const CreateMergeRequestThreadSchema = ProjectParamsSchema.extend({
1148
- merge_request_iid: z.string().or(z.number().describe("The IID of a merge request")),
1142
+ merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
1149
1143
  body: z.string().describe("The content of the thread"),
1150
1144
  position: MergeRequestThreadPositionSchema.optional().describe("Position when creating a diff note"),
1151
1145
  created_at: z.string().optional().describe("Date the thread was created at (ISO 8601 format)"),
@@ -1166,7 +1160,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
1166
1160
  .string()
1167
1161
  .optional()
1168
1162
  .describe("Return only milestones with a title or description matching the provided string"),
1169
- include_ancestors: z.boolean().optional().describe("Include ancestor groups"),
1163
+ include_ancestors: flexibleBoolean.optional().describe("Include ancestor groups"),
1170
1164
  updated_before: z
1171
1165
  .string()
1172
1166
  .optional()
@@ -1178,7 +1172,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
1178
1172
  }).merge(PaginationOptionsSchema);
1179
1173
  // Schema for getting a single milestone
1180
1174
  export const GetProjectMilestoneSchema = ProjectParamsSchema.extend({
1181
- milestone_id: z.string().or(z.number().describe("The ID of a project milestone")),
1175
+ milestone_id: z.coerce.string().describe("The ID of a project milestone"),
1182
1176
  });
1183
1177
  // Schema for creating a new milestone
1184
1178
  export const CreateProjectMilestoneSchema = ProjectParamsSchema.extend({
@@ -1210,26 +1204,26 @@ export const PromoteProjectMilestoneSchema = GetProjectMilestoneSchema;
1210
1204
  export const GetMilestoneBurndownEventsSchema = GetProjectMilestoneSchema.merge(PaginationOptionsSchema);
1211
1205
  // Add schemas for commit operations
1212
1206
  export const ListCommitsSchema = z.object({
1213
- project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
1207
+ project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
1214
1208
  ref_name: z.string().optional().describe("The name of a repository branch, tag or revision range, or if not given the default branch"),
1215
1209
  since: z.string().optional().describe("Only commits after or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
1216
1210
  until: z.string().optional().describe("Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
1217
1211
  path: z.string().optional().describe("The file path"),
1218
1212
  author: z.string().optional().describe("Search commits by commit author"),
1219
- all: z.boolean().optional().describe("Retrieve every commit from the repository"),
1220
- with_stats: z.boolean().optional().describe("Stats about each commit are added to the response"),
1221
- first_parent: z.boolean().optional().describe("Follow only the first parent commit upon seeing a merge commit"),
1213
+ all: flexibleBoolean.optional().describe("Retrieve every commit from the repository"),
1214
+ with_stats: flexibleBoolean.optional().describe("Stats about each commit are added to the response"),
1215
+ first_parent: flexibleBoolean.optional().describe("Follow only the first parent commit upon seeing a merge commit"),
1222
1216
  order: z.enum(["default", "topo"]).optional().describe("List commits in order"),
1223
- trailers: z.boolean().optional().describe("Parse and include Git trailers for every commit"),
1217
+ trailers: flexibleBoolean.optional().describe("Parse and include Git trailers for every commit"),
1224
1218
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
1225
1219
  per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
1226
1220
  });
1227
1221
  export const GetCommitSchema = z.object({
1228
- project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
1222
+ project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
1229
1223
  sha: z.string().describe("The commit hash or name of a repository branch or tag"),
1230
- stats: z.boolean().optional().describe("Include commit stats"),
1224
+ stats: flexibleBoolean.optional().describe("Include commit stats"),
1231
1225
  });
1232
1226
  export const GetCommitDiffSchema = z.object({
1233
- project_id: z.string().describe("Project ID or complete URL-encoded path to project"),
1227
+ project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
1234
1228
  sha: z.string().describe("The commit hash or name of a repository branch or tag"),
1235
1229
  });