diff --git a/index.ts b/index.ts index 615c3f7b..050d2524 100644 --- a/index.ts +++ b/index.ts @@ -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 }), }), }); diff --git a/schemas.ts b/schemas.ts index 9ff58bd4..f5f52375 100644 --- a/schemas.ts +++ b/schemas.ts @@ -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({ @@ -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()]) + .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