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

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