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);
        })
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
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.

Deploy Server

Other Tools