Skip to main content
Glama

list_org_packages

Retrieve and filter packages by type and visibility for a specific GitHub organization using mcp-github, with options for pagination and organization name input.

Instructions

List packages for an organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgYesOrganization name
package_typeYesThe type of package to filter for
pageNoPage number of the results
per_pageNoResults per page (max 100, default 30)
visibilityNoThe visibility to filter for

Implementation Reference

  • The core handler function that implements the list_org_packages tool by constructing the GitHub API URL, making the request, and parsing the response into PackageSchema array.
    export async function listOrgPackages( github_pat: string, org: string, options: { package_type: "npm" | "maven" | "rubygems" | "docker" | "nuget" | "container"; visibility?: "public" | "private" | "internal"; per_page?: number; page?: number; } = { package_type: "npm" } ): Promise<z.infer<typeof PackageSchema>[]> { const url = new URL(`https://api.github.com/orgs/${org}/packages`); if (options.package_type) url.searchParams.append("package_type", options.package_type); if (options.visibility) url.searchParams.append("visibility", options.visibility); if (options.per_page) url.searchParams.append("per_page", options.per_page.toString()); if (options.page) url.searchParams.append("page", options.page.toString()); const response = await githubRequest(github_pat, url.toString()); return z.array(PackageSchema).parse(response); }
  • Input schema definition for the list_org_packages tool, used in tool registration.
    export const ListOrgPackagesSchema = z.object({ org: z.string().describe("Organization name"), package_type: z.enum(["npm", "maven", "rubygems", "docker", "nuget", "container"]).describe("The type of package to filter for"), visibility: z.enum(["public", "private", "internal"]).optional().describe("The visibility to filter for"), per_page: z.number().optional().describe("Results per page (max 100, default 30)"), page: z.number().optional().describe("Page number of the results"), });
  • Extended input schema including github_pat, used for parsing arguments in the dispatch handler.
    export const _ListOrgPackagesSchema = ListOrgPackagesSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
  • src/index.ts:276-279 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema.
    name: "list_org_packages", description: "List packages for an organization", inputSchema: zodToJsonSchema(packages.ListOrgPackagesSchema), },
  • Top-level dispatch handler in index.ts that parses arguments and delegates to the packages.listOrgPackages implementation.
    case "list_org_packages": { const args = packages._ListOrgPackagesSchema.parse(params.arguments); const { github_pat, org, ...options } = args; const result = await packages.listOrgPackages(github_pat, org, options); 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