Skip to main content
Glama

list_repo_packages

Retrieve package information from GitHub repositories to manage dependencies and analyze project components. Specify package type and repository details to get structured results.

Instructions

List packages for a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
package_typeNoThe type of package to filter for
per_pageNoResults per page (max 100)
pageNoPage number of the results

Implementation Reference

  • Core handler function that fetches and parses the list of packages from the GitHub API for a specific repository.
    export async function listRepoPackages(
      github_pat: string,
      owner: string,
      repo: string,
      options: {
        package_type?: "npm" | "maven" | "rubygems" | "docker" | "nuget" | "container";
        per_page?: number;
        page?: number;
      } = {}
    ): Promise<z.infer<typeof PackageSchema>[]> {
      const url = new URL(`https://api.github.com/repos/${owner}/${repo}/packages`);
      
      if (options.package_type) url.searchParams.append("package_type", options.package_type);
      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 (without PAT) used for tool registration.
    export const ListRepoPackagesSchema = 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"]).optional().describe("The type of package to filter for"),
      per_page: z.number().optional().describe("Results per page (max 100)"),
      page: z.number().optional().describe("Page number of the results"),
    });
  • src/index.ts:285-289 (registration)
    Tool registration in the ListToolsRequest handler, defining name, description, and input schema.
    {
      name: "list_repo_packages",
      description: "List packages for a repository",
      inputSchema: zodToJsonSchema(packages.ListRepoPackagesSchema),
    },
  • src/index.ts:749-756 (registration)
    Dispatch handler in CallToolRequest that parses arguments and calls the listRepoPackages function.
    case "list_repo_packages": {
      const args = packages._ListRepoPackagesSchema.parse(params.arguments);
      const { github_pat, owner, repo, ...options } = args;
      const result = await packages.listRepoPackages(github_pat, owner, repo, options);
      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 but offers minimal information. It doesn't indicate whether this is a read-only operation, what permissions are required, whether it's paginated (though parameters suggest it), rate limits, or what the output format looks like. 'List' implies a read operation, but critical behavioral details are missing for a tool with 5 parameters.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward listing tool. Every word earns its place, making it easy to parse quickly.

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?

Given the complexity (5 parameters, no annotations, no output schema), the description is insufficiently complete. It doesn't explain the return format, pagination behavior (implied by parameters but not stated), authentication requirements, or error conditions. For a tool that likely returns structured package data, more context is needed to help the agent use it 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 schema description coverage is 100%, providing clear documentation for all 5 parameters including their types, descriptions, and enum values for 'package_type'. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting. No compensation is needed given the high coverage.

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 ('List') and resource ('packages for a repository'), making the purpose immediately understandable. It distinguishes itself from siblings like 'get_repo_package' (singular) and 'list_org_packages'/'list_user_packages' (different scopes), though it doesn't explicitly mention these distinctions. The verb+resource combination is specific enough for basic understanding.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'get_repo_package' (for a single package) or 'list_org_packages'/'list_user_packages' (for different scopes), nor does it specify prerequisites or appropriate contexts. The agent must infer usage from the name and parameters 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