Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_idYesProject ID or complete URL-encoded path to project
namespaceNoNamespace to fork to (full path)

Implementation Reference

  • 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)"), });
  • 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 });
  • 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 });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/harshmaur/gitlab-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server