fork_repository
Create a copy of a GitLab project in your account or specified namespace to modify code independently while preserving the original source.
Instructions
Fork a GitLab project to your account or specified namespace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | Project ID or complete URL-encoded path to project | |
| namespace | No | Namespace to fork to (full path) |
Implementation Reference
- schemas.ts:860-862 (schema)Input schema validation for the 'fork_repository' tool. It extends ProjectParamsSchema (which requires project_id) and adds an optional 'namespace' parameter for the target namespace to fork into.export const ForkRepositorySchema = ProjectParamsSchema.extend({ namespace: z.string().optional().describe("Namespace to fork to (full path)"), });
- schemas.ts:602-604 (schema)Output/response schema for forked repositories, extending the standard repository schema with 'forked_from_project' details.export const GitLabForkSchema = GitLabRepositorySchema.extend({ forked_from_project: GitLabForkParentSchema.optional(), // Made optional to handle cases where GitLab API doesn't include it });
- schemas.ts:589-601 (schema)Schema for the parent project details in a forked repository response.export const GitLabForkParentSchema = z.object({ name: z.string(), path_with_namespace: z.string(), // Changed from full_name to match GitLab API owner: z .object({ username: z.string(), // Changed from login to match GitLab API id: z.number(), avatar_url: z.string().nullable(), }) .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 });