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
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| package_name | Yes | The name of the package | |
| package_type | Yes | The type of package | |
| repo | Yes | Repository name |
Implementation Reference
- src/operations/packages.ts:189-201 (handler)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); }
- src/operations/packages.ts:89-94 (schema)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) }], }; }
- src/operations/packages.ts:96-98 (schema)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"), });