Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

delete-repository

Remove a GitHub repository permanently from GitHub Enterprise. This tool requires repository owner, name, and confirmation to delete the repository and all its contents.

Instructions

Delete a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmYesConfirmation for deletion (must be true)
ownerYesRepository owner
repoYesRepository name

Implementation Reference

  • The main handler function that parses input using DeleteRepositorySchema, checks confirmation, calls GitHub API to delete the repository, and returns success message.
    export async function deleteRepository(args: unknown): Promise<any> {
      const { owner, repo, confirm } = DeleteRepositorySchema.parse(args);
      
      if (!confirm) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'You must confirm deletion by setting confirm to true'
        );
      }
      
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        await github.getOctokit().repos.delete({
          owner,
          repo,
        });
    
        return {
          success: true,
          message: `Repository ${owner}/${repo} has been deleted`,
        };
      }, 'Failed to delete repository');
    }
  • Zod schema for validating the input parameters of delete-repository tool, extending OwnerRepoSchema and requiring confirm: true.
    export const DeleteRepositorySchema = OwnerRepoSchema.extend({
      confirm: z.boolean().refine(val => val === true, {
        message: 'You must confirm deletion by setting confirm to true',
      }),
    });
  • src/server.ts:199-221 (registration)
    Tool registration in the listTools response, defining the name, description, and input schema for the MCP protocol.
    {
      name: 'delete-repository',
      description: 'Delete a GitHub repository',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          confirm: {
            type: 'boolean',
            description: 'Confirmation for deletion (must be true)',
          },
        },
        required: ['owner', 'repo', 'confirm'],
        additionalProperties: false,
      },
    },
  • Dispatch case in the CallToolRequest handler switch statement that invokes the deleteRepository function.
    case 'delete-repository':
      result = await deleteRepository(parsedArgs);
      break;
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. 'Delete' implies a destructive, irreversible mutation, but the description doesn't explicitly warn about permanence, data loss, or authentication requirements. It lacks critical context like whether deletion is immediate, if forks are affected, or what happens to issues/pull requests, which is essential for a high-risk operation.

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 zero wasted words. It's front-loaded with the core action and resource, making it highly efficient. Every word earns its place by conveying essential information without redundancy or fluff.

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 the high-risk nature of deletion, no annotations, and no output schema, the description is incomplete. It fails to address critical behavioral aspects like irreversibility, permissions, or error conditions. For a destructive tool with 3 parameters, this minimal description leaves significant gaps that could lead to misuse by an AI agent.

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 input schema fully documents the three parameters (owner, repo, confirm) with clear descriptions. The description adds no additional parameter semantics beyond what's in the schema, such as explaining the purpose of the 'confirm' boolean as a safety measure. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 ('Delete') and resource ('a GitHub repository'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'update-repository' or 'create-repository' beyond the obvious verb difference, missing an opportunity to clarify its specific destructive role in the repository lifecycle.

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. It doesn't mention prerequisites (e.g., ownership permissions), irreversible consequences, or when deletion is appropriate compared to archiving or other repository management tools in the sibling list. This leaves the agent with insufficient context for safe decision-making.

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