@zereight/mcp-gitlab 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +17 -5
- package/build/schemas.js +2 -2
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -638,11 +638,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
638
638
|
}
|
|
639
639
|
switch (request.params.name) {
|
|
640
640
|
case "fork_repository": {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
641
|
+
const forkArgs = ForkRepositorySchema.parse(request.params.arguments);
|
|
642
|
+
try {
|
|
643
|
+
const forkedProject = await forkProject(forkArgs.project_id, forkArgs.namespace);
|
|
644
|
+
return {
|
|
645
|
+
content: [{ type: "text", text: JSON.stringify(forkedProject, null, 2) }],
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
catch (forkError) {
|
|
649
|
+
console.error("Error forking repository:", forkError);
|
|
650
|
+
let forkErrorMessage = "Failed to fork repository";
|
|
651
|
+
if (forkError instanceof Error) {
|
|
652
|
+
forkErrorMessage = `${forkErrorMessage}: ${forkError.message}`;
|
|
653
|
+
}
|
|
654
|
+
return {
|
|
655
|
+
content: [{ type: "text", text: JSON.stringify({ error: forkErrorMessage }, null, 2) }],
|
|
656
|
+
};
|
|
657
|
+
}
|
|
646
658
|
}
|
|
647
659
|
case "create_branch": {
|
|
648
660
|
const args = CreateBranchSchema.parse(request.params.arguments);
|
package/build/schemas.js
CHANGED
|
@@ -141,11 +141,11 @@ export const GitLabForkParentSchema = z.object({
|
|
|
141
141
|
username: z.string(), // Changed from login to match GitLab API
|
|
142
142
|
id: z.number(),
|
|
143
143
|
avatar_url: z.string(),
|
|
144
|
-
}),
|
|
144
|
+
}).optional(), // Made optional to handle cases where GitLab API doesn't include it
|
|
145
145
|
web_url: z.string(), // Changed from html_url to match GitLab API
|
|
146
146
|
});
|
|
147
147
|
export const GitLabForkSchema = GitLabRepositorySchema.extend({
|
|
148
|
-
forked_from_project: GitLabForkParentSchema, //
|
|
148
|
+
forked_from_project: GitLabForkParentSchema.optional(), // Made optional to handle cases where GitLab API doesn't include it
|
|
149
149
|
});
|
|
150
150
|
// Issue related schemas
|
|
151
151
|
export const GitLabLabelSchema = z.object({
|