Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4295,6 +4295,7 @@ async function createRepository(
initialize_with_readme: options.initialize_with_readme,
default_branch: "main",
path: options.name.toLowerCase().replaceAll(/\s+/g, "-"),
...(options.namespace_id !== undefined && { namespace_id: options.namespace_id }),
}),
});

Expand Down
12 changes: 12 additions & 0 deletions schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,12 @@ export const CreateRepositoryOptionsSchema = z.object({
description: z.string().optional(),
visibility: z.enum(["private", "internal", "public"]).optional(), // Changed from private to match GitLab API
initialize_with_readme: z.coerce.boolean().optional(), // Changed from auto_init to match GitLab API
namespace_id: z
.union([z.coerce.number(), z.string()])
.optional()
.describe(
"Namespace ID (numeric) or full path for the group/user to create the project under. Omit to use the authenticated user's personal namespace."
),
});

export const CreateIssueOptionsSchema = z.object({
Expand Down Expand Up @@ -1294,6 +1300,12 @@ export const CreateRepositorySchema = z.object({
.optional()
.describe("Repository visibility level"),
initialize_with_readme: z.coerce.boolean().optional().describe("Initialize with README.md"),
namespace_id: z
.union([z.coerce.number(), z.string()])
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should narrow this to numeric namespace IDs unless we also add a lookup step. GitLab's POST /projects API documents namespace_id as an integer group/subgroup ID, but this schema and the tool description accept a full path string and pass it straight through to the create-project request. That means inputs like "my-group/sub-group" are advertised as valid by the MCP schema, but they are not actually supported by this endpoint contract.

Could we either make this z.coerce.number().optional() and update the descriptions/test plan to say numeric namespace ID only, or resolve a full namespace path to its numeric ID before calling POST /projects?

.optional()
.describe(
"Namespace ID (numeric) or full path to create the project under. Omit to use the authenticated user's personal namespace."
),
});

export const GetFileContentsSchema = z
Expand Down
Loading