Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

create-repository

Create a new GitHub repository in your account with customizable settings including name, description, privacy options, and README initialization.

Instructions

Create a new GitHub repository in your account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoInitNoInitialize with README.md
descriptionNoRepository description
nameYesRepository name
privateNoWhether the repository should be private

Implementation Reference

  • The core handler function that parses input arguments, calls the GitHub API to create a repository (in user account or organization), handles errors with tryCatchAsync, and returns the new repository details.
    export async function createRepository(args: unknown): Promise<any> {
      const { name, description, private: isPrivate, autoInit, org } = CreateRepositorySchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        let data;
    
        if (org) {
          // Create repository in an organization
          const response = await github.getOctokit().repos.createInOrg({
            org,
            name,
            description,
            private: isPrivate,
            auto_init: autoInit,
          });
          data = response.data;
        } else {
          // Create repository for the authenticated user
          const response = await github.getOctokit().repos.createForAuthenticatedUser({
            name,
            description,
            private: isPrivate,
            auto_init: autoInit,
          });
          data = response.data;
        }
    
        return {
          id: data.id,
          name: data.name,
          full_name: data.full_name,
          private: data.private,
          description: data.description,
          html_url: data.html_url,
          clone_url: data.clone_url,
          ssh_url: data.ssh_url,
          created_at: data.created_at,
          updated_at: data.updated_at,
          default_branch: data.default_branch,
        };
      }, 'Failed to create repository');
    }
  • Zod schema used for runtime input validation in the createRepository handler.
    export const CreateRepositorySchema = z.object({
      name: z.string().min(1, 'Repository name is required'),
      description: z.string().optional(),
      private: z.boolean().optional(),
      autoInit: z.boolean().optional(),
      org: z.string().optional(),
    });
  • MCP tool inputSchema definition provided to clients via listTools.
    name: 'create-repository',
    description: 'Create a new GitHub repository in your account',
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Repository name',
        },
        description: {
          type: 'string',
          description: 'Repository description',
        },
        private: {
          type: 'boolean',
          description: 'Whether the repository should be private',
        },
        autoInit: {
          type: 'boolean',
          description: 'Initialize with README.md',
        },
      },
      required: ['name'],
      additionalProperties: false,
  • Switch case in callToolRequestHandler that dispatches execution to the createRepository function.
    case 'create-repository':
      result = await createRepository(parsedArgs);
      break;
  • src/server.ts:125-151 (registration)
    Tool registration entry in the listTools response, including name, description, and input schema.
    {
      name: 'create-repository',
      description: 'Create a new GitHub repository in your account',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Repository name',
          },
          description: {
            type: 'string',
            description: 'Repository description',
          },
          private: {
            type: 'boolean',
            description: 'Whether the repository should be private',
          },
          autoInit: {
            type: 'boolean',
            description: 'Initialize with README.md',
          },
        },
        required: ['name'],
        additionalProperties: false,
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write operation, it doesn't specify important behavioral aspects like whether this requires specific GitHub permissions, rate limits, what happens on duplicate names, or the response format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 gets straight to the point with zero wasted words. It's appropriately sized for a straightforward creation tool and front-loads the essential information without unnecessary elaboration.

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?

For a repository creation tool with no annotations and no output schema, the description is insufficient. It doesn't address important contextual aspects like authentication requirements, error conditions (e.g., duplicate names), what the tool returns, or how it differs from similar tools. The 100% schema coverage helps with parameters but doesn't compensate for the broader contextual gaps.

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?

The description doesn't mention any parameters, but the input schema has 100% description coverage with clear documentation for all 4 parameters. The baseline score of 3 is appropriate since the schema does the heavy lifting of parameter documentation, though the description adds no additional semantic context beyond the basic purpose.

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 ('Create') and resource ('new GitHub repository in your account'), making the purpose immediately understandable. However, it doesn't differentiate this from sibling tools like 'fork-repository' or 'update-repository' which also involve repository creation or modification, so it doesn't reach the highest score.

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' (for creating from an existing repo) or 'update-repository' (for modifying existing ones). It also doesn't mention prerequisites such as authentication requirements or account permissions needed to create repositories.

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/piyushgIITian/github-enterprice-mcp'

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