Skip to main content
Glama

create_repo

Create a new GitHub repository by specifying a name, description, and privacy setting to organize and share code projects.

Instructions

Create a new GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_nameYesThe name of the repository to create
descriptionNoA description of the repository
privateNoWhether the repository should be private

Implementation Reference

  • Handler for the 'create_repo' tool. Validates the repository name, then sends a POST request to GitHub's /user/repos endpoint to create a new repository with the provided name, description, and privacy setting. Returns the API response or an error.
    } else if (request.params.name === 'create_repo') {
      const repo_name = args.repo_name;
      if (!repo_name) {
        throw new McpError(ErrorCode.InvalidParams, 'Repository name is required');
      }
    
      try {
        const response = await this.axiosInstance.post('/user/repos', {
          name: repo_name,
          description: args.description,
          private: args.private ?? false,
        });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          return {
            content: [
              {
                type: 'text',
                text: `GitHub API error: ${
                  error.response?.data.message ?? error.message
                }`,
              },
            ],
            isError: true,
          };
        }
        throw error;
      }
  • Schema definition for the 'create_repo' tool, including name, description, and input schema specifying required 'repo_name' and optional 'description' and 'private' fields.
    name: 'create_repo',
    description: 'Create a new GitHub repository',
    inputSchema: {
      type: 'object',
      properties: {
        repo_name: {
          type: 'string',
          description: 'The name of the repository to create',
        },
        description: {
          type: 'string',
          description: 'A description of the repository',
        },
        private: {
          type: 'boolean',
          description: 'Whether the repository should be private',
          default: false,
        },
      },
      required: ['repo_name'],
    },
  • src/index.ts:94-161 (registration)
    Registration of available tools in the ListToolsRequestSchema handler, including the 'create_repo' tool in the tools array.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'get_user',
          description: 'Get GitHub user information',
          inputSchema: {
            type: 'object',
            properties: {
              username: {
                type: 'string',
                description: 'GitHub username',
              },
            },
            required: ['username'],
          },
        },
        {
          name: 'create_repo',
          description: 'Create a new GitHub repository',
          inputSchema: {
            type: 'object',
            properties: {
              repo_name: {
                type: 'string',
                description: 'The name of the repository to create',
              },
              description: {
                type: 'string',
                description: 'A description of the repository',
              },
              private: {
                type: 'boolean',
                description: 'Whether the repository should be private',
                default: false,
              },
            },
            required: ['repo_name'],
          },
        },
        {
          name: 'push_to_repo',
          description: 'Push content to a GitHub repository',
          inputSchema: {
            type: 'object',
            properties: {
              repo_name: {
                type: 'string',
                description: 'The name of the repository to push to',
              },
              file_path: {
                type: 'string',
                description: 'The path where the file should be created in the repository',
              },
              content: {
                type: 'string',
                description: 'The content to push to the repository',
              },
              message: {
                type: 'string',
                description: 'The commit message',
                default: 'Update via GitHub MCP',
              },
            },
            required: ['repo_name', 'file_path', 'content'],
          },
        },
      ],
    }));
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create' which implies a write/mutation operation, but doesn't mention authentication needs, rate limits, whether the operation is idempotent, or what happens on success/failure. This leaves significant gaps for an agent to understand the tool's behavior.

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 states exactly what the tool does with zero wasted words. It's appropriately sized and front-loaded with the core functionality.

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 mutation tool with no annotations and no output schema, the description is insufficient. It doesn't address authentication requirements, error conditions, return values, or how it differs from sibling tools. The agent would need to guess about critical behavioral aspects of this repository creation operation.

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 schema has 100% description coverage, so all parameters are documented in the structured schema. The description adds no additional parameter information beyond what's already in the schema properties. This meets the baseline expectation when schema coverage is complete.

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'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'push_to_repo' which also interacts with repositories, missing an opportunity for clearer distinction.

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 'push_to_repo' (which might modify existing repositories) or 'get_user' (which retrieves information). There's no mention of prerequisites, such as authentication requirements or GitHub account permissions.

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

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