@zereight/mcp-gitlab 2.0.5 → 2.0.7
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/README.md +1 -0
- package/build/index.js +197 -100
- package/build/schemas.js +106 -100
- package/build/test/readonly-mcp-tests.js +381 -0
- package/package.json +5 -1
package/build/schemas.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { flexibleBoolean, flexibleBooleanNullable } from "./customSchemas.js";
|
|
3
2
|
// Base schemas for common types
|
|
4
3
|
export const GitLabAuthorSchema = z.object({
|
|
5
4
|
name: z.string(),
|
|
@@ -36,7 +35,7 @@ export const GitLabPipelineSchema = z.object({
|
|
|
36
35
|
label: z.string().optional(),
|
|
37
36
|
group: z.string().optional(),
|
|
38
37
|
tooltip: z.string().optional(),
|
|
39
|
-
has_details:
|
|
38
|
+
has_details: z.boolean().optional(),
|
|
40
39
|
details_path: z.string().optional(),
|
|
41
40
|
illustration: z
|
|
42
41
|
.object({
|
|
@@ -57,7 +56,7 @@ export const GitLabPipelineJobSchema = z.object({
|
|
|
57
56
|
stage: z.string(),
|
|
58
57
|
name: z.string(),
|
|
59
58
|
ref: z.string(),
|
|
60
|
-
tag:
|
|
59
|
+
tag: z.boolean(),
|
|
61
60
|
coverage: z.coerce.number().nullable().optional(),
|
|
62
61
|
created_at: z.string(),
|
|
63
62
|
started_at: z.string().nullable().optional(),
|
|
@@ -98,7 +97,7 @@ export const GitLabPipelineTriggerJobSchema = z.object({
|
|
|
98
97
|
stage: z.string(),
|
|
99
98
|
name: z.string(),
|
|
100
99
|
ref: z.string(),
|
|
101
|
-
tag:
|
|
100
|
+
tag: z.boolean(),
|
|
102
101
|
coverage: z.number().nullable().optional(),
|
|
103
102
|
created_at: z.string(),
|
|
104
103
|
started_at: z.string().nullable().optional(),
|
|
@@ -135,13 +134,13 @@ export const GitLabPipelineTriggerJobSchema = z.object({
|
|
|
135
134
|
})
|
|
136
135
|
.optional(),
|
|
137
136
|
web_url: z.string().optional(),
|
|
138
|
-
allow_failure:
|
|
139
|
-
archived:
|
|
137
|
+
allow_failure: z.boolean().optional(),
|
|
138
|
+
archived: z.boolean().optional(),
|
|
140
139
|
source: z.string().optional(),
|
|
141
140
|
erased_at: z.string().nullable().optional(),
|
|
142
141
|
project: z
|
|
143
142
|
.object({
|
|
144
|
-
ci_job_token_scope_enabled:
|
|
143
|
+
ci_job_token_scope_enabled: z.boolean().optional(),
|
|
145
144
|
})
|
|
146
145
|
.optional(),
|
|
147
146
|
downstream_pipeline: z
|
|
@@ -189,7 +188,7 @@ export const ListPipelinesSchema = z
|
|
|
189
188
|
.describe("The status of pipelines"),
|
|
190
189
|
ref: z.string().optional().describe("The ref of pipelines"),
|
|
191
190
|
sha: z.string().optional().describe("The SHA of pipelines"),
|
|
192
|
-
yaml_errors:
|
|
191
|
+
yaml_errors: z.boolean()
|
|
193
192
|
.optional()
|
|
194
193
|
.describe("Returns pipelines with invalid configurations"),
|
|
195
194
|
username: z.string().optional().describe("The username of the user who triggered pipelines"),
|
|
@@ -222,7 +221,7 @@ export const ListPipelineJobsSchema = z
|
|
|
222
221
|
.enum(["created", "pending", "running", "failed", "success", "canceled", "skipped", "manual"])
|
|
223
222
|
.optional()
|
|
224
223
|
.describe("The scope of jobs to show"),
|
|
225
|
-
include_retried:
|
|
224
|
+
include_retried: z.boolean().optional().describe("Whether to include retried jobs"),
|
|
226
225
|
})
|
|
227
226
|
.merge(PaginationOptionsSchema);
|
|
228
227
|
// Schema for listing trigger jobs (bridges) in a pipeline
|
|
@@ -348,12 +347,12 @@ export const GitLabNamespaceSchema = z.object({
|
|
|
348
347
|
plan: z.string().optional(),
|
|
349
348
|
end_date: z.string().nullable().optional(),
|
|
350
349
|
trial_ends_on: z.string().nullable().optional(),
|
|
351
|
-
trial:
|
|
350
|
+
trial: z.boolean().optional(),
|
|
352
351
|
root_repository_size: z.number().optional(),
|
|
353
352
|
projects_count: z.number().optional(),
|
|
354
353
|
});
|
|
355
354
|
export const GitLabNamespaceExistsResponseSchema = z.object({
|
|
356
|
-
exists:
|
|
355
|
+
exists: z.boolean(),
|
|
357
356
|
suggests: z.array(z.string()).optional(),
|
|
358
357
|
});
|
|
359
358
|
// Repository related schemas
|
|
@@ -373,7 +372,7 @@ export const GitLabRepositorySchema = z.object({
|
|
|
373
372
|
owner: GitLabOwnerSchema.optional(),
|
|
374
373
|
web_url: z.string().optional(),
|
|
375
374
|
description: z.string().nullable(),
|
|
376
|
-
fork:
|
|
375
|
+
fork: z.boolean().optional(),
|
|
377
376
|
ssh_url_to_repo: z.string().optional(),
|
|
378
377
|
http_url_to_repo: z.string().optional(),
|
|
379
378
|
created_at: z.string().optional(),
|
|
@@ -394,7 +393,7 @@ export const GitLabRepositorySchema = z.object({
|
|
|
394
393
|
topics: z.array(z.string()).optional(),
|
|
395
394
|
tag_list: z.array(z.string()).optional(), // deprecated but still present
|
|
396
395
|
open_issues_count: z.number().optional(),
|
|
397
|
-
archived:
|
|
396
|
+
archived: z.boolean().optional(),
|
|
398
397
|
forks_count: z.number().optional(),
|
|
399
398
|
star_count: z.number().optional(),
|
|
400
399
|
permissions: z
|
|
@@ -415,17 +414,17 @@ export const GitLabRepositorySchema = z.object({
|
|
|
415
414
|
.nullable(),
|
|
416
415
|
})
|
|
417
416
|
.optional(),
|
|
418
|
-
container_registry_enabled:
|
|
417
|
+
container_registry_enabled: z.boolean().optional(),
|
|
419
418
|
container_registry_access_level: z.string().optional(),
|
|
420
|
-
issues_enabled:
|
|
421
|
-
merge_requests_enabled:
|
|
419
|
+
issues_enabled: z.boolean().optional(),
|
|
420
|
+
merge_requests_enabled: z.boolean().optional(),
|
|
422
421
|
merge_requests_template: z.string().nullable().optional(),
|
|
423
|
-
wiki_enabled:
|
|
424
|
-
jobs_enabled:
|
|
425
|
-
snippets_enabled:
|
|
426
|
-
can_create_merge_request_in:
|
|
427
|
-
resolve_outdated_diff_discussions:
|
|
428
|
-
shared_runners_enabled:
|
|
422
|
+
wiki_enabled: z.boolean().optional(),
|
|
423
|
+
jobs_enabled: z.boolean().optional(),
|
|
424
|
+
snippets_enabled: z.boolean().optional(),
|
|
425
|
+
can_create_merge_request_in: z.boolean().optional(),
|
|
426
|
+
resolve_outdated_diff_discussions: z.boolean().nullable().optional(),
|
|
427
|
+
shared_runners_enabled: z.boolean().optional(),
|
|
429
428
|
shared_with_groups: z
|
|
430
429
|
.array(z.object({
|
|
431
430
|
group_id: z.coerce.string(),
|
|
@@ -449,7 +448,7 @@ export const GitLabFileContentSchema = z.object({
|
|
|
449
448
|
blob_id: z.string(), // Added to match GitLab API
|
|
450
449
|
commit_id: z.string(), // ID of the current file version
|
|
451
450
|
last_commit_id: z.string(), // Added to match GitLab API
|
|
452
|
-
execute_filemode:
|
|
451
|
+
execute_filemode: z.boolean().optional(), // Added to match GitLab API
|
|
453
452
|
});
|
|
454
453
|
export const GitLabDirectoryContentSchema = z.object({
|
|
455
454
|
name: z.string(),
|
|
@@ -483,7 +482,7 @@ export const GetRepositoryTreeSchema = z.object({
|
|
|
483
482
|
.string()
|
|
484
483
|
.optional()
|
|
485
484
|
.describe("The name of a repository branch or tag. Defaults to the default branch."),
|
|
486
|
-
recursive:
|
|
485
|
+
recursive: z.boolean().optional().describe("Boolean value to get a recursive tree"),
|
|
487
486
|
per_page: z.number().optional().describe("Number of results to show per page"),
|
|
488
487
|
page_token: z.string().optional().describe("The tree record ID for pagination"),
|
|
489
488
|
pagination: z.string().optional().describe("Pagination method (keyset)"),
|
|
@@ -536,7 +535,7 @@ export const GitLabMilestonesSchema = z.object({
|
|
|
536
535
|
state: z.string(),
|
|
537
536
|
updated_at: z.string(),
|
|
538
537
|
created_at: z.string(),
|
|
539
|
-
expired:
|
|
538
|
+
expired: z.boolean(),
|
|
540
539
|
web_url: z.string().optional(),
|
|
541
540
|
});
|
|
542
541
|
// Input schemas for operations
|
|
@@ -544,7 +543,7 @@ export const CreateRepositoryOptionsSchema = z.object({
|
|
|
544
543
|
name: z.string(),
|
|
545
544
|
description: z.string().optional(),
|
|
546
545
|
visibility: z.enum(["private", "internal", "public"]).optional(), // Changed from private to match GitLab API
|
|
547
|
-
initialize_with_readme:
|
|
546
|
+
initialize_with_readme: z.boolean().optional(), // Changed from auto_init to match GitLab API
|
|
548
547
|
});
|
|
549
548
|
export const CreateIssueOptionsSchema = z.object({
|
|
550
549
|
title: z.string(),
|
|
@@ -559,9 +558,9 @@ export const GitLabDiffSchema = z.object({
|
|
|
559
558
|
a_mode: z.string(),
|
|
560
559
|
b_mode: z.string(),
|
|
561
560
|
diff: z.string(),
|
|
562
|
-
new_file:
|
|
563
|
-
renamed_file:
|
|
564
|
-
deleted_file:
|
|
561
|
+
new_file: z.boolean(),
|
|
562
|
+
renamed_file: z.boolean(),
|
|
563
|
+
deleted_file: z.boolean(),
|
|
565
564
|
});
|
|
566
565
|
// Response schemas for operations
|
|
567
566
|
export const GitLabCreateUpdateFileResponseSchema = z.object({
|
|
@@ -594,8 +593,8 @@ export const GitLabCompareResultSchema = z.object({
|
|
|
594
593
|
.optional(),
|
|
595
594
|
commits: z.array(GitLabCommitSchema),
|
|
596
595
|
diffs: z.array(GitLabDiffSchema),
|
|
597
|
-
compare_timeout:
|
|
598
|
-
compare_same_ref:
|
|
596
|
+
compare_timeout: z.boolean().optional(),
|
|
597
|
+
compare_same_ref: z.boolean().optional(),
|
|
599
598
|
});
|
|
600
599
|
// Issue related schemas
|
|
601
600
|
export const GitLabLabelSchema = z.object({
|
|
@@ -608,9 +607,9 @@ export const GitLabLabelSchema = z.object({
|
|
|
608
607
|
open_issues_count: z.number().optional(),
|
|
609
608
|
closed_issues_count: z.number().optional(),
|
|
610
609
|
open_merge_requests_count: z.number().optional(),
|
|
611
|
-
subscribed:
|
|
610
|
+
subscribed: z.boolean().optional(),
|
|
612
611
|
priority: z.number().nullable().optional(),
|
|
613
|
-
is_project_label:
|
|
612
|
+
is_project_label: z.boolean().optional(),
|
|
614
613
|
});
|
|
615
614
|
export const GitLabMilestoneSchema = z.object({
|
|
616
615
|
id: z.coerce.string(),
|
|
@@ -650,9 +649,9 @@ export const GitLabIssueSchema = z.object({
|
|
|
650
649
|
human_total_time_spent: z.string().nullable(),
|
|
651
650
|
})
|
|
652
651
|
.optional(),
|
|
653
|
-
confidential:
|
|
652
|
+
confidential: z.boolean().optional(),
|
|
654
653
|
due_date: z.string().nullable().optional(),
|
|
655
|
-
discussion_locked:
|
|
654
|
+
discussion_locked: z.boolean().nullable().optional(),
|
|
656
655
|
weight: z.number().nullable().optional(),
|
|
657
656
|
issue_type: z.string().describe("the type of issue.").nullish(),
|
|
658
657
|
});
|
|
@@ -692,8 +691,8 @@ export const GitLabMergeRequestSchema = z.object({
|
|
|
692
691
|
title: z.string(),
|
|
693
692
|
description: z.string().nullable(),
|
|
694
693
|
state: z.string(),
|
|
695
|
-
merged:
|
|
696
|
-
draft:
|
|
694
|
+
merged: z.boolean().optional(),
|
|
695
|
+
draft: z.boolean().optional(),
|
|
697
696
|
author: GitLabUserSchema,
|
|
698
697
|
assignees: z.array(GitLabUserSchema).optional(),
|
|
699
698
|
reviewers: z.array(GitLabUserSchema).optional(),
|
|
@@ -709,15 +708,15 @@ export const GitLabMergeRequestSchema = z.object({
|
|
|
709
708
|
detailed_merge_status: z.string().optional(),
|
|
710
709
|
merge_status: z.string().optional(),
|
|
711
710
|
merge_error: z.string().nullable().optional(),
|
|
712
|
-
work_in_progress:
|
|
713
|
-
blocking_discussions_resolved:
|
|
714
|
-
should_remove_source_branch:
|
|
715
|
-
force_remove_source_branch:
|
|
716
|
-
allow_collaboration:
|
|
717
|
-
allow_maintainer_to_push:
|
|
711
|
+
work_in_progress: z.boolean().optional(),
|
|
712
|
+
blocking_discussions_resolved: z.boolean().optional(),
|
|
713
|
+
should_remove_source_branch: z.boolean().nullable().optional(),
|
|
714
|
+
force_remove_source_branch: z.boolean().nullable().optional(),
|
|
715
|
+
allow_collaboration: z.boolean().optional(),
|
|
716
|
+
allow_maintainer_to_push: z.boolean().optional(),
|
|
718
717
|
changes_count: z.string().nullable().optional(),
|
|
719
|
-
merge_when_pipeline_succeeds:
|
|
720
|
-
squash:
|
|
718
|
+
merge_when_pipeline_succeeds: z.boolean().optional(),
|
|
719
|
+
squash: z.boolean().optional(),
|
|
721
720
|
labels: z.array(z.string()).optional(),
|
|
722
721
|
});
|
|
723
722
|
export const LineRangeSchema = z
|
|
@@ -730,7 +729,7 @@ export const LineRangeSchema = z
|
|
|
730
729
|
.optional()
|
|
731
730
|
.describe("CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_10_15'. Get this from GitLab diff API response, never fabricate."),
|
|
732
731
|
type: z
|
|
733
|
-
.enum(["new", "old", "expanded"])
|
|
732
|
+
.enum(["new", "old", "expanded", "logic", "style"])
|
|
734
733
|
.nullable()
|
|
735
734
|
.optional()
|
|
736
735
|
.describe("Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. MUST match the line_code format and old_line/new_line values."),
|
|
@@ -754,7 +753,7 @@ export const LineRangeSchema = z
|
|
|
754
753
|
.optional()
|
|
755
754
|
.describe("CRITICAL: Line identifier in format '{file_path_sha1_hash}_{old_line_number}_{new_line_number}'. USUALLY REQUIRED for GitLab diff comments despite being optional in schema. Example: 'a1b2c3d4e5f6_12_17'. Must be from same file as start.line_code."),
|
|
756
755
|
type: z
|
|
757
|
-
.enum(["new", "old", "expanded"])
|
|
756
|
+
.enum(["new", "old", "expanded", "logic", "style"])
|
|
758
757
|
.nullable()
|
|
759
758
|
.optional()
|
|
760
759
|
.describe("Line type: 'old' = deleted/original line, 'new' = added/modified line, null = unchanged context. SHOULD MATCH start.type for consistent ranges (don't mix old/new types)."),
|
|
@@ -781,13 +780,13 @@ export const GitLabDiscussionNoteSchema = z.object({
|
|
|
781
780
|
author: GitLabUserSchema.optional(),
|
|
782
781
|
created_at: z.string().optional(),
|
|
783
782
|
updated_at: z.string().optional(),
|
|
784
|
-
system:
|
|
783
|
+
system: z.boolean().optional(),
|
|
785
784
|
noteable_id: z.coerce.string().optional(),
|
|
786
785
|
noteable_type: z.enum(["Issue", "MergeRequest", "Snippet", "Commit", "Epic"]).optional(),
|
|
787
786
|
project_id: z.coerce.string().optional(),
|
|
788
787
|
noteable_iid: z.coerce.string().nullable().optional(),
|
|
789
|
-
resolvable:
|
|
790
|
-
resolved:
|
|
788
|
+
resolvable: z.boolean().optional(),
|
|
789
|
+
resolved: z.boolean().optional(),
|
|
791
790
|
resolved_by: GitLabUserSchema.nullable().optional(),
|
|
792
791
|
resolved_at: z.string().nullable().optional(),
|
|
793
792
|
position: z
|
|
@@ -835,7 +834,7 @@ export const PaginatedResponseSchema = z.object({
|
|
|
835
834
|
});
|
|
836
835
|
export const GitLabDiscussionSchema = z.object({
|
|
837
836
|
id: z.coerce.string(),
|
|
838
|
-
individual_note:
|
|
837
|
+
individual_note: z.boolean(),
|
|
839
838
|
notes: z.array(GitLabDiscussionNoteSchema),
|
|
840
839
|
});
|
|
841
840
|
// Create a schema for paginated discussions response
|
|
@@ -859,7 +858,7 @@ export const UpdateMergeRequestNoteSchema = ProjectParamsSchema.extend({
|
|
|
859
858
|
discussion_id: z.coerce.string().describe("The ID of a thread"),
|
|
860
859
|
note_id: z.coerce.string().describe("The ID of a thread note"),
|
|
861
860
|
body: z.string().optional().describe("The content of the note or reply"),
|
|
862
|
-
resolved:
|
|
861
|
+
resolved: z.boolean().optional().describe("Resolve or unresolve the note"),
|
|
863
862
|
})
|
|
864
863
|
.refine(data => data.body !== undefined || data.resolved !== undefined, {
|
|
865
864
|
message: "At least one of 'body' or 'resolved' must be provided",
|
|
@@ -910,7 +909,7 @@ export const CreateRepositorySchema = z.object({
|
|
|
910
909
|
.enum(["private", "internal", "public"])
|
|
911
910
|
.optional()
|
|
912
911
|
.describe("Repository visibility level"),
|
|
913
|
-
initialize_with_readme:
|
|
912
|
+
initialize_with_readme: z.boolean().optional().describe("Initialize with README.md"),
|
|
914
913
|
});
|
|
915
914
|
export const GetFileContentsSchema = ProjectParamsSchema.extend({
|
|
916
915
|
file_path: z.string().describe("Path to the file or directory"),
|
|
@@ -946,12 +945,12 @@ const MergeRequestOptionsSchema = {
|
|
|
946
945
|
.optional()
|
|
947
946
|
.describe("The ID of the users to assign as reviewers of the MR"),
|
|
948
947
|
labels: z.array(z.string()).optional().describe("Labels for the MR"),
|
|
949
|
-
draft:
|
|
948
|
+
draft: z.boolean().optional().describe("Create as draft merge request"),
|
|
950
949
|
allow_collaboration: z.boolean().optional().describe("Allow commits from upstream members"),
|
|
951
|
-
remove_source_branch:
|
|
950
|
+
remove_source_branch: z.boolean().nullable()
|
|
952
951
|
.optional()
|
|
953
952
|
.describe("Flag indicating if a merge request should remove the source branch when merging."),
|
|
954
|
-
squash:
|
|
953
|
+
squash: z.boolean().nullable()
|
|
955
954
|
.optional()
|
|
956
955
|
.describe("If true, squash all commits into a single commit on merge."),
|
|
957
956
|
};
|
|
@@ -968,7 +967,7 @@ export const CreateBranchSchema = ProjectParamsSchema.extend({
|
|
|
968
967
|
export const GetBranchDiffsSchema = ProjectParamsSchema.extend({
|
|
969
968
|
from: z.string().describe("The base branch or commit SHA to compare from"),
|
|
970
969
|
to: z.string().describe("The target branch or commit SHA to compare to"),
|
|
971
|
-
straight:
|
|
970
|
+
straight: z.boolean()
|
|
972
971
|
.optional()
|
|
973
972
|
.describe("Comparison method: false for '...' (default), true for '--'"),
|
|
974
973
|
excluded_file_patterns: z
|
|
@@ -998,17 +997,17 @@ export const UpdateMergeRequestSchema = GetMergeRequestSchema.extend({
|
|
|
998
997
|
.boolean()
|
|
999
998
|
.optional()
|
|
1000
999
|
.describe("Flag indicating if the source branch should be removed"),
|
|
1001
|
-
squash:
|
|
1002
|
-
draft:
|
|
1000
|
+
squash: z.boolean().optional().describe("Squash commits into a single commit when merging"),
|
|
1001
|
+
draft: z.boolean().optional().describe("Work in progress merge request"),
|
|
1003
1002
|
});
|
|
1004
1003
|
export const MergeMergeRequestSchema = ProjectParamsSchema.extend({
|
|
1005
1004
|
merge_request_iid: z.coerce.string().optional().describe("The IID of a merge request"),
|
|
1006
|
-
auto_merge:
|
|
1005
|
+
auto_merge: z.boolean().optional().default(false).describe("If true, the merge request merges when the pipeline succeeds."),
|
|
1007
1006
|
merge_commit_message: z.string().optional().describe("Custom merge commit message"),
|
|
1008
|
-
merge_when_pipeline_succeeds:
|
|
1009
|
-
should_remove_source_branch:
|
|
1007
|
+
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"),
|
|
1008
|
+
should_remove_source_branch: z.boolean().optional().default(false).describe("Remove source branch after merge"),
|
|
1010
1009
|
squash_commit_message: z.string().optional().describe("Custom squash commit message"),
|
|
1011
|
-
squash:
|
|
1010
|
+
squash: z.boolean().optional().default(false).describe("Squash commits into a single commit when merging"),
|
|
1012
1011
|
});
|
|
1013
1012
|
export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
1014
1013
|
view: z.enum(["inline", "parallel"]).optional().describe("Diff view type"),
|
|
@@ -1016,7 +1015,7 @@ export const GetMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
|
1016
1015
|
export const ListMergeRequestDiffsSchema = GetMergeRequestSchema.extend({
|
|
1017
1016
|
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
1018
1017
|
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
|
1019
|
-
unidiff:
|
|
1018
|
+
unidiff: z.boolean()
|
|
1020
1019
|
.optional()
|
|
1021
1020
|
.describe("Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5."),
|
|
1022
1021
|
});
|
|
@@ -1045,21 +1044,19 @@ export const ListIssuesSchema = z
|
|
|
1045
1044
|
.describe("Return issues assigned to the given username"),
|
|
1046
1045
|
author_id: z.coerce.string().optional().describe("Return issues created by the given user ID"),
|
|
1047
1046
|
author_username: z.string().optional().describe("Return issues created by the given username"),
|
|
1048
|
-
confidential:
|
|
1047
|
+
confidential: z.boolean().optional().describe("Filter confidential or public issues"),
|
|
1049
1048
|
created_after: z.string().optional().describe("Return issues created after the given time"),
|
|
1050
1049
|
created_before: z.string().optional().describe("Return issues created before the given time"),
|
|
1051
1050
|
due_date: z.string().optional().describe("Return issues that have the due date"),
|
|
1052
1051
|
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
1053
1052
|
milestone: z.string().optional().describe("Milestone title"),
|
|
1054
1053
|
issue_type: z
|
|
1055
|
-
.
|
|
1054
|
+
.enum(["issue", "incident", "test_case", "task"])
|
|
1056
1055
|
.optional()
|
|
1057
|
-
.nullable()
|
|
1058
1056
|
.describe("Filter to a given type of issue. One of issue, incident, test_case or task"),
|
|
1059
1057
|
iteration_id: z.coerce
|
|
1060
1058
|
.string()
|
|
1061
1059
|
.optional()
|
|
1062
|
-
.nullable()
|
|
1063
1060
|
.describe("Return issues assigned to the given iteration ID. None returns issues that do not belong to an iteration. Any returns issues that belong to an iteration. "),
|
|
1064
1061
|
scope: z
|
|
1065
1062
|
.enum(["created_by_me", "assigned_to_me", "all"])
|
|
@@ -1072,7 +1069,7 @@ export const ListIssuesSchema = z
|
|
|
1072
1069
|
.describe("Return issues with a specific state"),
|
|
1073
1070
|
updated_after: z.string().optional().describe("Return issues updated after the given time"),
|
|
1074
1071
|
updated_before: z.string().optional().describe("Return issues updated before the given time"),
|
|
1075
|
-
with_labels_details:
|
|
1072
|
+
with_labels_details: z.boolean().optional().describe("Return more details for each label"),
|
|
1076
1073
|
})
|
|
1077
1074
|
.merge(PaginationOptionsSchema);
|
|
1078
1075
|
// Merge Requests API operation schemas
|
|
@@ -1157,7 +1154,7 @@ export const ListMergeRequestsSchema = z
|
|
|
1157
1154
|
.enum(["yes", "no"])
|
|
1158
1155
|
.optional()
|
|
1159
1156
|
.describe("Filter merge requests against their wip status"),
|
|
1160
|
-
with_labels_details:
|
|
1157
|
+
with_labels_details: z.boolean().optional().describe("Return more details for each label"),
|
|
1161
1158
|
})
|
|
1162
1159
|
.merge(PaginationOptionsSchema);
|
|
1163
1160
|
export const GetIssueSchema = z.object({
|
|
@@ -1170,8 +1167,8 @@ export const UpdateIssueSchema = z.object({
|
|
|
1170
1167
|
title: z.string().optional().describe("The title of the issue"),
|
|
1171
1168
|
description: z.string().optional().describe("The description of the issue"),
|
|
1172
1169
|
assignee_ids: z.array(z.number()).optional().describe("Array of user IDs to assign issue to"),
|
|
1173
|
-
confidential:
|
|
1174
|
-
discussion_locked:
|
|
1170
|
+
confidential: z.boolean().optional().describe("Set the issue to be confidential"),
|
|
1171
|
+
discussion_locked: z.boolean().optional().describe("Flag to lock discussions"),
|
|
1175
1172
|
due_date: z.string().optional().describe("Date the issue is due (YYYY-MM-DD)"),
|
|
1176
1173
|
labels: z.array(z.string()).optional().describe("Array of label names"),
|
|
1177
1174
|
milestone_id: z.coerce.string().optional().describe("Milestone ID to assign"),
|
|
@@ -1217,7 +1214,7 @@ export const DeleteIssueLinkSchema = z.object({
|
|
|
1217
1214
|
export const ListNamespacesSchema = z
|
|
1218
1215
|
.object({
|
|
1219
1216
|
search: z.string().optional().describe("Search term for namespaces"),
|
|
1220
|
-
owned:
|
|
1217
|
+
owned: z.boolean().optional().describe("Filter for namespaces owned by current user"),
|
|
1221
1218
|
})
|
|
1222
1219
|
.merge(PaginationOptionsSchema);
|
|
1223
1220
|
export const GetNamespaceSchema = z.object({
|
|
@@ -1233,15 +1230,15 @@ export const GetProjectSchema = z.object({
|
|
|
1233
1230
|
export const ListProjectsSchema = z
|
|
1234
1231
|
.object({
|
|
1235
1232
|
search: z.string().optional().describe("Search term for projects"),
|
|
1236
|
-
search_namespaces:
|
|
1233
|
+
search_namespaces: z.boolean()
|
|
1237
1234
|
.optional()
|
|
1238
1235
|
.describe("Needs to be true if search is full path"),
|
|
1239
|
-
owned:
|
|
1240
|
-
membership:
|
|
1236
|
+
owned: z.boolean().optional().describe("Filter for projects owned by current user"),
|
|
1237
|
+
membership: z.boolean()
|
|
1241
1238
|
.optional()
|
|
1242
1239
|
.describe("Filter for projects where current user is a member"),
|
|
1243
|
-
simple:
|
|
1244
|
-
archived:
|
|
1240
|
+
simple: z.boolean().optional().describe("Return only limited fields"),
|
|
1241
|
+
archived: z.boolean().optional().describe("Filter for archived projects"),
|
|
1245
1242
|
visibility: z
|
|
1246
1243
|
.enum(["public", "internal", "private"])
|
|
1247
1244
|
.optional()
|
|
@@ -1272,13 +1269,13 @@ export const ListLabelsSchema = z.object({
|
|
|
1272
1269
|
.boolean()
|
|
1273
1270
|
.optional()
|
|
1274
1271
|
.describe("Whether or not to include issue and merge request counts"),
|
|
1275
|
-
include_ancestor_groups:
|
|
1272
|
+
include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
|
|
1276
1273
|
search: z.string().optional().describe("Keyword to filter labels by"),
|
|
1277
1274
|
});
|
|
1278
1275
|
export const GetLabelSchema = z.object({
|
|
1279
1276
|
project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
|
|
1280
1277
|
label_id: z.coerce.string().describe("The ID or title of a project's label"),
|
|
1281
|
-
include_ancestor_groups:
|
|
1278
|
+
include_ancestor_groups: z.boolean().optional().describe("Include ancestor groups"),
|
|
1282
1279
|
});
|
|
1283
1280
|
export const CreateLabelSchema = z.object({
|
|
1284
1281
|
project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
|
|
@@ -1308,14 +1305,14 @@ export const DeleteLabelSchema = z.object({
|
|
|
1308
1305
|
export const ListGroupProjectsSchema = z
|
|
1309
1306
|
.object({
|
|
1310
1307
|
group_id: z.coerce.string().describe("Group ID or path"),
|
|
1311
|
-
include_subgroups:
|
|
1308
|
+
include_subgroups: z.boolean().optional().describe("Include projects from subgroups"),
|
|
1312
1309
|
search: z.string().optional().describe("Search term to filter projects"),
|
|
1313
1310
|
order_by: z
|
|
1314
1311
|
.enum(["name", "path", "created_at", "updated_at", "last_activity_at"])
|
|
1315
1312
|
.optional()
|
|
1316
1313
|
.describe("Field to sort by"),
|
|
1317
1314
|
sort: z.enum(["asc", "desc"]).optional().describe("Sort direction"),
|
|
1318
|
-
archived:
|
|
1315
|
+
archived: z.boolean().optional().describe("Filter for archived projects"),
|
|
1319
1316
|
visibility: z
|
|
1320
1317
|
.enum(["public", "internal", "private"])
|
|
1321
1318
|
.optional()
|
|
@@ -1330,17 +1327,17 @@ export const ListGroupProjectsSchema = z
|
|
|
1330
1327
|
.describe("Filter projects with merge requests feature enabled"),
|
|
1331
1328
|
min_access_level: z.number().optional().describe("Filter by minimum access level"),
|
|
1332
1329
|
with_programming_language: z.string().optional().describe("Filter by programming language"),
|
|
1333
|
-
starred:
|
|
1334
|
-
statistics:
|
|
1335
|
-
with_custom_attributes:
|
|
1336
|
-
with_security_reports:
|
|
1330
|
+
starred: z.boolean().optional().describe("Filter by starred projects"),
|
|
1331
|
+
statistics: z.boolean().optional().describe("Include project statistics"),
|
|
1332
|
+
with_custom_attributes: z.boolean().optional().describe("Include custom attributes"),
|
|
1333
|
+
with_security_reports: z.boolean().optional().describe("Include security reports"),
|
|
1337
1334
|
})
|
|
1338
1335
|
.merge(PaginationOptionsSchema);
|
|
1339
1336
|
// Add wiki operation schemas
|
|
1340
1337
|
export const ListWikiPagesSchema = z
|
|
1341
1338
|
.object({
|
|
1342
1339
|
project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
|
|
1343
|
-
with_content:
|
|
1340
|
+
with_content: z.boolean().optional().describe("Include content of the wiki pages"),
|
|
1344
1341
|
})
|
|
1345
1342
|
.merge(PaginationOptionsSchema);
|
|
1346
1343
|
export const GetWikiPageSchema = z.object({
|
|
@@ -1451,7 +1448,7 @@ export const GitLabDraftNoteSchema = z.object({
|
|
|
1451
1448
|
created_at: z.string().optional(),
|
|
1452
1449
|
updated_at: z.string().optional(),
|
|
1453
1450
|
position: MergeRequestThreadPositionSchema.nullable().optional(),
|
|
1454
|
-
resolve_discussion:
|
|
1451
|
+
resolve_discussion: z.boolean().optional(),
|
|
1455
1452
|
}).transform((data) => ({
|
|
1456
1453
|
// Normalize the response to always have consistent field names
|
|
1457
1454
|
id: data.id,
|
|
@@ -1476,7 +1473,7 @@ export const CreateDraftNoteSchema = ProjectParamsSchema.extend({
|
|
|
1476
1473
|
merge_request_iid: z.coerce.string().describe("The IID of a merge request"),
|
|
1477
1474
|
body: z.string().describe("The content of the draft note"),
|
|
1478
1475
|
position: MergeRequestThreadPositionCreateSchema.optional().describe("Position when creating a diff note"),
|
|
1479
|
-
resolve_discussion:
|
|
1476
|
+
resolve_discussion: z.boolean().optional().describe("Whether to resolve the discussion when publishing"),
|
|
1480
1477
|
});
|
|
1481
1478
|
// Update draft note schema
|
|
1482
1479
|
export const UpdateDraftNoteSchema = ProjectParamsSchema.extend({
|
|
@@ -1484,7 +1481,7 @@ export const UpdateDraftNoteSchema = ProjectParamsSchema.extend({
|
|
|
1484
1481
|
draft_note_id: z.coerce.string().describe("The ID of the draft note"),
|
|
1485
1482
|
body: z.string().optional().describe("The content of the draft note"),
|
|
1486
1483
|
position: MergeRequestThreadPositionCreateSchema.optional().describe("Position when creating a diff note"),
|
|
1487
|
-
resolve_discussion:
|
|
1484
|
+
resolve_discussion: z.boolean().optional().describe("Whether to resolve the discussion when publishing"),
|
|
1488
1485
|
});
|
|
1489
1486
|
// Delete draft note schema
|
|
1490
1487
|
export const DeleteDraftNoteSchema = ProjectParamsSchema.extend({
|
|
@@ -1523,7 +1520,7 @@ export const ListProjectMilestonesSchema = ProjectParamsSchema.extend({
|
|
|
1523
1520
|
.string()
|
|
1524
1521
|
.optional()
|
|
1525
1522
|
.describe("Return only milestones with a title or description matching the provided string"),
|
|
1526
|
-
include_ancestors:
|
|
1523
|
+
include_ancestors: z.boolean().optional().describe("Include ancestor groups"),
|
|
1527
1524
|
updated_before: z
|
|
1528
1525
|
.string()
|
|
1529
1526
|
.optional()
|
|
@@ -1582,26 +1579,27 @@ export const ListCommitsSchema = z.object({
|
|
|
1582
1579
|
.describe("Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ"),
|
|
1583
1580
|
path: z.string().optional().describe("The file path"),
|
|
1584
1581
|
author: z.string().optional().describe("Search commits by commit author"),
|
|
1585
|
-
all:
|
|
1586
|
-
with_stats:
|
|
1582
|
+
all: z.boolean().optional().describe("Retrieve every commit from the repository"),
|
|
1583
|
+
with_stats: z.boolean()
|
|
1587
1584
|
.optional()
|
|
1588
1585
|
.describe("Stats about each commit are added to the response"),
|
|
1589
|
-
first_parent:
|
|
1586
|
+
first_parent: z.boolean()
|
|
1590
1587
|
.optional()
|
|
1591
1588
|
.describe("Follow only the first parent commit upon seeing a merge commit"),
|
|
1592
1589
|
order: z.enum(["default", "topo"]).optional().describe("List commits in order"),
|
|
1593
|
-
trailers:
|
|
1590
|
+
trailers: z.boolean().optional().describe("Parse and include Git trailers for every commit"),
|
|
1594
1591
|
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
1595
1592
|
per_page: z.number().optional().describe("Number of items per page (max: 100, default: 20)"),
|
|
1596
1593
|
});
|
|
1597
1594
|
export const GetCommitSchema = z.object({
|
|
1598
1595
|
project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
|
|
1599
1596
|
sha: z.string().describe("The commit hash or name of a repository branch or tag"),
|
|
1600
|
-
stats:
|
|
1597
|
+
stats: z.boolean().optional().describe("Include commit stats"),
|
|
1601
1598
|
});
|
|
1602
1599
|
export const GetCommitDiffSchema = z.object({
|
|
1603
1600
|
project_id: z.coerce.string().describe("Project ID or complete URL-encoded path to project"),
|
|
1604
1601
|
sha: z.string().describe("The commit hash or name of a repository branch or tag"),
|
|
1602
|
+
full_diff: z.boolean().optional().describe("Whether to return the full diff or only first page (default: false)"),
|
|
1605
1603
|
});
|
|
1606
1604
|
// Schema for listing issues assigned to the current user
|
|
1607
1605
|
export const MyIssuesSchema = z.object({
|
|
@@ -1686,14 +1684,14 @@ export const ListGroupIterationsSchema = z
|
|
|
1686
1684
|
.string()
|
|
1687
1685
|
.optional()
|
|
1688
1686
|
.describe("Return only iterations with a title matching the provided string."),
|
|
1689
|
-
|
|
1687
|
+
search_in: z
|
|
1690
1688
|
.array(z.enum(["title", "cadence_title"]))
|
|
1691
1689
|
.optional()
|
|
1692
1690
|
.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]."),
|
|
1693
|
-
include_ancestors:
|
|
1691
|
+
include_ancestors: z.boolean()
|
|
1694
1692
|
.optional()
|
|
1695
1693
|
.describe("Include iterations for group and its ancestors. Defaults to true."),
|
|
1696
|
-
include_descendants:
|
|
1694
|
+
include_descendants: z.boolean()
|
|
1697
1695
|
.optional()
|
|
1698
1696
|
.describe("Include iterations for group and its descendants. Defaults to false."),
|
|
1699
1697
|
updated_before: z
|
|
@@ -1727,7 +1725,7 @@ export const GitLabEventSchema = z.object({
|
|
|
1727
1725
|
created_at: z.string(),
|
|
1728
1726
|
author: GitLabEventAuthorSchema,
|
|
1729
1727
|
author_username: z.string(),
|
|
1730
|
-
imported:
|
|
1728
|
+
imported: z.boolean(),
|
|
1731
1729
|
imported_from: z.string(),
|
|
1732
1730
|
}).passthrough(); // Allow additional fields
|
|
1733
1731
|
// List events schema
|
|
@@ -1752,3 +1750,11 @@ export const GetProjectEventsSchema = z.object({
|
|
|
1752
1750
|
page: z.number().optional().describe("Returns the specified results page. Default: 1"),
|
|
1753
1751
|
per_page: z.number().optional().describe("Number of results per page. Default: 20"),
|
|
1754
1752
|
});
|
|
1753
|
+
// GraphQL generic execution schema
|
|
1754
|
+
export const ExecuteGraphQLSchema = z.object({
|
|
1755
|
+
query: z.string().describe("GraphQL query string"),
|
|
1756
|
+
variables: z
|
|
1757
|
+
.record(z.any())
|
|
1758
|
+
.optional()
|
|
1759
|
+
.describe("Variables object for the GraphQL query"),
|
|
1760
|
+
});
|