Skip to main content
Glama

get-repo-info

Retrieve detailed information about a GitHub repository by specifying its owner and name, enabling users to access repository data through the GitHub MCP Server.

Instructions

Get information about a specific GitHub repository

Input Schema

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

Implementation Reference

  • The async handler function `getRepoInfo` that executes the tool logic: fetches GitHub repo info via Octokit and returns JSON-formatted response.
    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}`,
            },
          ],
        };
      }
    };
  • The tool schema definition including name, description, and inputSchema for validation.
    "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 tool handlers in the `toolHandlers` object, mapping tool name to handler function; used by MCP call tool handler.
    export const toolHandlers = {
      "search-repos": searchRepos,
      "get-repo-info": getRepoInfo,
      "list-issues": listIssues,
      "create-issue": createIssue,
    };
  • TypeScript type definition for the tool input arguments.
    type GetRepoInfoArgs = {
      owner: string;
      repo: string;
    };
  • src/handlers.ts:19-32 (registration)
    MCP server request handlers for listing tools (using `tools` object) and calling tools (dispatching to `toolHandlers[name]`).
        server.setRequestHandler(ListToolsRequestSchema, async () => ({
            tools: Object.values(tools)
        }));
        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 but offers minimal information. It doesn't specify whether this is a read-only operation, what permissions might be required, rate limits, error conditions, or what format the returned information takes. The description is too vague to provide adequate behavioral context.

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 simple 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 tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what type of repository information is returned, how to interpret results, or any behavioral aspects. Given the lack of structured data, the description should provide more context about the tool's operation and outputs.

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 input schema has 100% description coverage, with both parameters ('owner' and 'repo') clearly documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline score of 3 for high schema coverage.

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 verb ('Get information') and resource ('about a specific GitHub repository'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'search-repos' or 'list-issues', which would require more specificity about what type of repository information is retrieved.

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 'search-repos' or 'list-issues'. It doesn't mention prerequisites, context for usage, or any exclusions. The agent must infer usage from the tool name alone.

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

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