Skip to main content
Glama
ddukbg

GitHub Enterprise MCP Server

update-repository

Modify GitHub Enterprise repository settings including description, privacy, default branch, and feature toggles for issues, projects, wiki, and archive status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner
repoYesRepository name
descriptionNoNew description
privateNoChange privacy setting
default_branchNoChange default branch
has_issuesNoEnable/disable issues
has_projectsNoEnable/disable projects
has_wikiNoEnable/disable wiki
archivedNoArchive/unarchive repository

Implementation Reference

  • Main MCP tool handler for 'update-repository': validates parameters owner/repo, calls underlying RepositoryAPI.updateRepository, formats and returns the updated repository info or error.
    async ({ owner, repo, ...options }) => {
      try {
        // Parameter validation
        if (!owner || typeof owner !== 'string' || owner.trim() === '') {
          return {
            content: [
              {
                type: "text",
                text: "Repository owner is required."
              }
            ]
          };
        }
    
        if (!repo || typeof repo !== 'string' || repo.trim() === '') {
          return {
            content: [
              {
                type: "text",
                text: "Repository name is required."
              }
            ]
          };
        }
    
        const repository = await context.repository.updateRepository(owner, repo, options);
        const formattedRepo = formatRepository(repository);
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully updated repository: ${formattedRepo.full_name}\n\n${JSON.stringify(formattedRepo, null, 2)}`
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text",
              text: `Error updating repository: ${error.message}`
            }
          ]
        };
      }
    }
  • MCP server registration of the 'update-repository' tool with input schema and handler reference
    server.tool(
      "update-repository",
      {
        owner: z.string().min(1).describe("Repository owner"),
        repo: z.string().min(1).describe("Repository name"),
        description: z.string().optional().describe("New description"),
        private: z.boolean().optional().describe("Change privacy setting"),
        default_branch: z.string().optional().describe("Change default branch"),
        has_issues: z.boolean().optional().describe("Enable/disable issues"),
        has_projects: z.boolean().optional().describe("Enable/disable projects"),
        has_wiki: z.boolean().optional().describe("Enable/disable wiki"),
        archived: z.boolean().optional().describe("Archive/unarchive repository")
      },
      async ({ owner, repo, ...options }) => {
        try {
          // Parameter validation
          if (!owner || typeof owner !== 'string' || owner.trim() === '') {
            return {
              content: [
                {
                  type: "text",
                  text: "Repository owner is required."
                }
              ]
            };
          }
    
          if (!repo || typeof repo !== 'string' || repo.trim() === '') {
            return {
              content: [
                {
                  type: "text",
                  text: "Repository name is required."
                }
              ]
            };
          }
    
          const repository = await context.repository.updateRepository(owner, repo, options);
          const formattedRepo = formatRepository(repository);
    
          return {
            content: [
              {
                type: "text",
                text: `Successfully updated repository: ${formattedRepo.full_name}\n\n${JSON.stringify(formattedRepo, null, 2)}`
              }
            ]
          };
        } catch (error: any) {
          return {
            content: [
              {
                type: "text",
                text: `Error updating repository: ${error.message}`
              }
            ]
          };
        }
      }
    );
  • Input schema (zod) for the update-repository MCP tool defining parameters like owner, repo, description, private, etc.
    {
      owner: z.string().min(1).describe("Repository owner"),
      repo: z.string().min(1).describe("Repository name"),
      description: z.string().optional().describe("New description"),
      private: z.boolean().optional().describe("Change privacy setting"),
      default_branch: z.string().optional().describe("Change default branch"),
      has_issues: z.boolean().optional().describe("Enable/disable issues"),
      has_projects: z.boolean().optional().describe("Enable/disable projects"),
      has_wiki: z.boolean().optional().describe("Enable/disable wiki"),
      archived: z.boolean().optional().describe("Archive/unarchive repository")
    },
  • Underlying GitHub API handler in RepositoryAPI class: performs PATCH request to update repository settings.
    /**
     * Update repository
     */
    async updateRepository(owner: string, repo: string, options: UpdateRepoOptions): Promise<GitHubRepository> {
      return this.client.patch<GitHubRepository>(`repos/${owner}/${repo}`, options);
    }
  • TypeScript interface defining options for repository update (UpdateRepoOptions) used by the API handler.
    export interface UpdateRepoOptions {
      name?: string;
      description?: string;
      homepage?: string;
      private?: boolean;
      visibility?: 'public' | 'private' | 'internal';
      has_issues?: boolean;
      has_projects?: boolean;
      has_wiki?: boolean;
      has_downloads?: boolean;
      has_discussions?: boolean;
      default_branch?: string;
      allow_squash_merge?: boolean;
      allow_merge_commit?: boolean;
      allow_rebase_merge?: boolean;
      allow_auto_merge?: boolean;
      delete_branch_on_merge?: boolean;
      archived?: boolean;
    } 
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

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