Skip to main content
Glama

get_repo_package

Retrieve a specific package from a GitHub repository by specifying the owner, repo, package type, and package name. Ideal for developers managing dependencies or workflows.

Instructions

Get a package for a repository

Input Schema

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

Implementation Reference

  • The core handler function that performs the GitHub API request to retrieve package information for a specific repository package.
    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 defining the input parameters for the get_repo_package tool, used in tool registration.
    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"), });
  • src/index.ts:300-304 (registration)
    Tool registration in the listTools handler, defining name, description, and input schema.
    { name: "get_repo_package", description: "Get a package for a repository", inputSchema: zodToJsonSchema(packages.GetRepoPackageSchema), },
  • src/index.ts:776-783 (registration)
    Dispatch handler case in callToolRequest that parses arguments and invokes 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) }], }; }
  • Extended schema used internally for parsing arguments including the GitHub PAT.
    export const _GetRepoPackageSchema = GetRepoPackageSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });

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