Skip to main content
Glama

create_repository

Initialize a new GitLab project with customizable settings like name, description, visibility, and README file. Streamline project creation on the enhanced GitLab MCP Server with activity tracking and group projects.

Instructions

Create a new GitLab project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNo
initialize_with_readmeNo
nameNo
visibilityNoprivate

Implementation Reference

  • MCP tool handler for 'create_repository': parses arguments using the schema and delegates to GitLabApi.createRepository method.
    case "create_repository": {
      const args = CreateRepositorySchema.parse(request.params.arguments);
      const repository = await gitlabApi.createRepository(args);
      return { content: [{ type: "text", text: JSON.stringify(repository, null, 2) }] };
    }
  • Core implementation of repository creation: sends POST request to GitLab /projects endpoint with options.
    async createRepository(
      options: z.infer<typeof CreateRepositoryOptionsSchema>
    ): Promise<GitLabRepository> {
      const response = await fetch(`${this.apiUrl}/projects`, {
        method: "POST",
        headers: {
          "Authorization": `Bearer ${this.token}`,
          "Content-Type": "application/json"
        },
        body: JSON.stringify({
          name: options.name,
          description: options.description,
          visibility: options.visibility,
          initialize_with_readme: options.initialize_with_readme
        })
      });
    
      if (!response.ok) {
        throw new McpError(
          ErrorCode.InternalError,
          `GitLab API error: ${response.statusText}`
        );
      }
    
      return GitLabRepositorySchema.parse(await response.json());
    }
  • src/index.ts:120-124 (registration)
    Tool registration in ALL_TOOLS array, defining name, description, input schema, and readOnly flag.
    {
      name: "create_repository",
      description: "Create a new GitLab project",
      inputSchema: createJsonSchema(CreateRepositorySchema),
      readOnly: false
  • Zod schemas for input validation: CreateRepositoryOptionsSchema defines parameters, aliased as CreateRepositorySchema.
    export const CreateRepositoryOptionsSchema = z.object({
      name: z.string(),
      description: z.string().optional(),
      visibility: z.enum(['private', 'internal', 'public']).default('private'),
      initialize_with_readme: z.boolean().default(true)
    });
    
    export const CreateBranchOptionsSchema = z.object({
      name: z.string(),
      ref: z.string().optional()
    });
    
    export const CreateIssueOptionsSchema = z.object({
      title: z.string(),
      description: z.string().optional(),
      assignee_ids: z.array(z.number()).optional(),
      milestone_id: z.number().optional(),
      labels: z.array(z.string()).optional()
    });
    
    export const CreateMergeRequestOptionsSchema = z.object({
      title: z.string(),
      description: z.string().optional(),
      source_branch: z.string(),
      target_branch: z.string(),
      allow_collaboration: z.boolean().optional(),
      draft: z.boolean().optional()
    });
    
    // Tool Schemas
    export const CreateOrUpdateFileSchema = z.object({
      project_id: z.string(),
      file_path: z.string(),
      content: z.string(),
      commit_message: z.string(),
      branch: z.string(),
      previous_path: z.string().optional()
    });
    
    export const SearchRepositoriesSchema = z.object({
      search: z.string(),
      page: z.number().optional(),
      per_page: z.number().optional()
    });
    
    export const CreateRepositorySchema = CreateRepositoryOptionsSchema;
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 of behavioral disclosure. It states this is a creation operation, implying mutation, but doesn't mention authentication requirements, rate limits, error conditions, or what happens upon success (e.g., returns a project object). This leaves significant gaps for a mutation tool.

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, direct sentence with no wasted words. It's front-loaded and efficiently communicates the core action, making it easy to parse quickly.

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 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain parameters, behavioral traits, or return values, leaving the agent with insufficient information to use the tool effectively.

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

Parameters2/5

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

Schema description coverage is 0%, meaning none of the 4 parameters have descriptions in the schema. The tool description adds no information about parameters like 'name', 'description', 'visibility', or 'initialize_with_readme', failing to compensate for the schema's lack of documentation.

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 verb ('Create') and resource ('new GitLab project'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'fork_repository' or 'create_group_wiki_page' which also create resources, so it misses full differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'fork_repository' or 'create_group_wiki_page'. It lacks context about prerequisites, permissions needed, or typical scenarios for creating a repository versus other creation tools.

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

Related 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/yoda-digital/mcp-gitlab-server'

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