Compare commits

..

1 Commits

Author SHA1 Message Date
66d53f508c FIX: bug get issues 2025-06-03 22:57:08 +09:00
3 changed files with 7 additions and 12 deletions

View File

@ -907,15 +907,14 @@ async function listIssues(
// Add all query parameters
Object.entries(options).forEach(([key, value]) => {
if (value !== undefined) {
const keys = ["labels", "assignee_username"];
if ( keys.includes(key)) {
if (key === "labels" ) {
if (Array.isArray(value)) {
// Handle array of labels
value.forEach(label => {
url.searchParams.append(`${key}[]`, label.toString());
url.searchParams.append("labels[]", label.toString());
});
} else {
url.searchParams.append(`${key}[]`, value.toString());
url.searchParams.append("labels[]", value.toString());
}
} else {
url.searchParams.append(key, value.toString());
@ -1200,8 +1199,6 @@ async function createMergeRequest(
labels: options.labels?.join(","),
allow_collaboration: options.allow_collaboration,
draft: options.draft,
remove_source_branch: options.remove_source_branch,
squash: options.squash,
}),
});

View File

@ -1,6 +1,6 @@
{
"name": "@zereight/mcp-gitlab",
"version": "1.0.59",
"version": "1.0.58",
"description": "MCP server for using the GitLab API",
"license": "MIT",
"author": "zereight",

View File

@ -212,7 +212,7 @@ export const GitLabUsersResponseSchema = z.record(
id: z.number(),
username: z.string(),
name: z.string(),
avatar_url: z.string().nullable(),
avatar_url: z.string(),
web_url: z.string(),
}).nullable()
);
@ -253,7 +253,7 @@ export const GitLabNamespaceExistsResponseSchema = z.object({
export const GitLabOwnerSchema = z.object({
username: z.string(), // Changed from login to match GitLab API
id: z.number(),
avatar_url: z.string().nullable(),
avatar_url: z.string(),
web_url: z.string(), // Changed from html_url to match GitLab API
name: z.string(), // Added as GitLab includes full name
state: z.string(), // Added as GitLab includes user state
@ -467,8 +467,6 @@ export const CreateMergeRequestOptionsSchema = z.object({
labels: z.array(z.string()).optional(),
allow_collaboration: z.boolean().optional(), // Changed from maintainer_can_modify to match GitLab API
draft: z.boolean().optional(),
remove_source_branch: z.boolean().optional().describe("Flag indicating if a merge request should remove the source branch when merging."),
squash: z.boolean().optional().describe("If true, squash all commits into a single commit on merge.")
});
export const GitLabDiffSchema = z.object({
@ -595,7 +593,7 @@ export const GitLabForkParentSchema = z.object({
.object({
username: z.string(), // Changed from login to match GitLab API
id: z.number(),
avatar_url: z.string().nullable(),
avatar_url: z.string(),
})
.optional(), // Made optional to handle cases where GitLab API doesn't include it
web_url: z.string(), // Changed from html_url to match GitLab API