Skip to main content
Glama
alsonwangkhem

GitHub MCP Server

get-repo-info

Retrieve detailed information about a specific GitHub repository, including owner and repository name, to access repository data through the GitHub API.

Instructions

Get information about a specific GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name

Implementation Reference

  • The core handler function `getRepoInfo` that executes the tool logic by fetching GitHub repository details using Octokit and returning formatted JSON.
    const getRepoInfo = async (args: GetRepoInfoArgs) => {
      const { owner, repo } = args;
      
      try {
        const response = await octokit.rest.repos.get({
          owner,
          repo,
        });
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  name: response.data.full_name,
                  description: response.data.description,
                  stars: response.data.stargazers_count,
                  forks: response.data.forks_count,
                  issues: response.data.open_issues_count,
                  language: response.data.language,
                  created_at: response.data.created_at,
                  updated_at: response.data.updated_at,
                  url: response.data.html_url,
                  default_branch: response.data.default_branch,
                  license: response.data.license?.name || "No license",
                  topics: response.data.topics,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
        return {
          content: [
            {
              type: "text",
              text: `Error getting repository information: ${errorMessage}`,
            },
          ],
        };
      }
    };
  • Input schema definition for the get-repo-info tool, specifying required parameters owner and repo.
    "get-repo-info": {
      name: "get-repo-info",
      description: "Get information about a specific GitHub repository",
      inputSchema: {
        type: "object",
        properties: {
          owner: {
            type: "string",
            description: "Repository owner (username or organization)",
          },
          repo: {
            type: "string",
            description: "Repository name",
          }
        },
        required: ["owner", "repo"],
      },
    },
  • src/tools.ts:322-327 (registration)
    Registration of the getRepoInfo handler function under the 'get-repo-info' key in the toolHandlers export, used by the MCP server for dispatching tool calls.
    export const toolHandlers = {
      "search-repos": searchRepos,
      "get-repo-info": getRepoInfo,
      "list-issues": listIssues,
      "create-issue": createIssue,
    };
  • TypeScript type definition for the input arguments of the get-repo-info tool handler.
    type GetRepoInfoArgs = {
      owner: string;
      repo: string;
    };
  • src/handlers.ts:22-31 (registration)
    MCP server request handler for CallToolRequestSchema that dispatches to the specific tool handler based on name, enabling execution of get-repo-info.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
        type ToolHandlerKey = keyof typeof toolHandlers;
        const { name, arguments: params } = request.params ?? {};
        const handler = toolHandlers[name as ToolHandlerKey];
    
        if (!handler) throw new Error("tool not found");
    
        type HandlerParams = Parameters<typeof handler>;
        return handler(params as any);
    })
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 'Get information' implies a read-only operation, it doesn't specify authentication requirements, rate limits, what specific information is returned, error conditions, or whether this is a lightweight vs comprehensive repository query. The description is too minimal for a tool with no annotation coverage.

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 extremely concise - a single sentence that directly states the tool's purpose. There's zero wasted language, and the information is front-loaded. Every word earns its place in this minimal description.

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 that there are no annotations and no output schema, the description is insufficiently complete. For a tool that presumably returns repository information (name, description, stars, forks, etc.), the description should at least hint at what information is returned. The current description leaves too much unspecified about the tool's behavior and output.

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 description coverage is 100%, with both parameters ('owner' and 'repo') well-documented in the schema. The description doesn't add any parameter semantics beyond what the schema already provides. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

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 tool's purpose with a specific verb ('Get information') and resource ('about a specific GitHub repository'), making it immediately understandable. However, it doesn't distinguish this tool from potential sibling tools like 'search-repos' or 'list-issues' that might also provide repository information in different contexts.

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 when this tool is appropriate compared to 'search-repos' (which might return multiple repositories) or 'list-issues' (which focuses on issues rather than repository metadata). There are no explicit when/when-not instructions or alternative recommendations.

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

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