Skip to main content
Glama

get_repo_package

Retrieve package information from GitHub repositories by specifying owner, repository, package type, and package name.

Instructions

Get a package for a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
package_typeYesThe type of package
package_nameYesThe name of the package

Implementation Reference

  • The core handler function that makes the GitHub API request to retrieve a specific package from a repository and parses the response using the PackageSchema.
    export async function getRepoPackage(
      github_pat: string,
      owner: string,
      repo: string,
      package_type: "npm" | "maven" | "rubygems" | "docker" | "nuget" | "container",
      package_name: string
    ): Promise<z.infer<typeof PackageSchema>> {
      const response = await githubRequest(
        github_pat,
        `https://api.github.com/repos/${owner}/${repo}/packages/${package_type}/${package_name}`
      );
      return PackageSchema.parse(response);
    }
  • Zod schema definitions for input validation of the get_repo_package tool, including the public schema and the internal one with github_pat.
    export const GetRepoPackageSchema = z.object({
      owner: z.string().describe("Repository owner (username or organization)"),
      repo: z.string().describe("Repository name"),
      package_type: z.enum(["npm", "maven", "rubygems", "docker", "nuget", "container"]).describe("The type of package"),
      package_name: z.string().describe("The name of the package"),
    });
    
    export const _GetRepoPackageSchema = GetRepoPackageSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • src/index.ts:300-304 (registration)
    Tool registration in the ListToolsRequest handler, defining name, description, and input schema.
    {
      name: "get_repo_package",
      description: "Get a package for a repository",
      inputSchema: zodToJsonSchema(packages.GetRepoPackageSchema),
    },
  • Dispatch handler in the main CallToolRequestSchema that validates arguments using _GetRepoPackageSchema and calls the getRepoPackage function.
    case "get_repo_package": {
      const args = packages._GetRepoPackageSchema.parse(params.arguments);
      const { github_pat, owner, repo, package_type, package_name } = args;
      const result = await packages.getRepoPackage(github_pat, owner, repo, package_type, package_name);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
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. It states a read operation ('Get'), implying it's likely non-destructive, but doesn't specify authentication requirements, rate limits, error conditions, or the return format. This leaves significant gaps for a tool that interacts with repository packages.

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

Conciseness4/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could be slightly more informative without losing conciseness.

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 4 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what 'Get' entails (e.g., returns package metadata, downloads files), authentication needs, or how it differs from sibling package tools. The agent lacks sufficient context to use this tool effectively.

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, clearly documenting all four required parameters (owner, repo, package_type, package_name) with details like enum values for package_type. The description adds no additional parameter semantics beyond what the schema provides, so the baseline score of 3 is appropriate.

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 ('Get') and resource ('a package for a repository'), making the purpose understandable. However, it doesn't distinguish this tool from similar siblings like 'get_org_package' or 'get_user_package', which also retrieve packages but from different scopes.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_org_package' or 'get_user_package'. The description lacks context about prerequisites, such as needing repository access, or exclusions, leaving the agent to 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/MissionSquad/mcp-github'

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