Skip to main content
Glama
harshmaur

GitLab MCP Server

by harshmaur

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
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions forking to 'your account or specified namespace' but lacks critical behavioral details: whether this requires authentication, what permissions are needed, if it's a destructive operation (it creates a new repository, not destructive to the original), rate limits, or what the output looks like (e.g., returns the new repository details). For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Fork a GitLab project') and adds necessary qualification ('to your account or specified namespace'). There is zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on authentication requirements, error conditions, what the fork operation entails (e.g., copies branches, issues), and response format. For a tool that creates a new repository, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('project_id' and 'namespace') with clear descriptions. The description adds minimal value beyond the schema by implying 'namespace' is optional (defaulting to 'your account'), but doesn't provide additional context like format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Fork') and resource ('a GitLab project'), specifying the destination ('to your account or specified namespace'). It distinguishes from siblings like 'create_repository' by focusing on forking existing projects rather than creating new ones from scratch. However, it doesn't explicitly contrast with all potential sibling operations like cloning or branching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you want to create a copy of an existing GitLab project, either to your personal account or a specific namespace. It doesn't provide explicit when-not-to-use guidance, alternatives (e.g., cloning vs. forking), or prerequisites such as required permissions or project accessibility.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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