Skip to main content
Glama

list_user_packages

Retrieve and filter packages for a GitHub user by type and visibility to manage dependencies and access control.

Instructions

List packages for a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesUsername
package_typeNoThe type of package to filter for
visibilityNoThe visibility to filter for
per_pageNoResults per page (max 100)
pageNoPage number of the results

Implementation Reference

  • The core handler function that executes the list_user_packages tool by constructing the GitHub API URL for user packages and fetching/parsing the response.
    export async function listUserPackages(
      github_pat: string,
      username: 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/users/${username}/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 definitions for the list_user_packages tool, including the public schema and the internal schema extended with github_pat.
    export const ListUserPackagesSchema = z.object({
      username: z.string().describe("Username"),
      package_type: z.enum(["npm", "maven", "rubygems", "docker", "nuget", "container"]).optional().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)"),
      page: z.number().optional().describe("Page number of the results"),
    });
    
    export const _ListUserPackagesSchema = ListUserPackagesSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • src/index.ts:280-284 (registration)
    Tool registration in the MCP server's list of tools, defining name, description, and input schema.
    {
      name: "list_user_packages",
      description: "List packages for a user",
      inputSchema: zodToJsonSchema(packages.ListUserPackagesSchema),
    },
  • Dispatch handler in the main CallToolRequest handler that parses arguments and calls the listUserPackages function.
    case "list_user_packages": {
      const args = packages._ListUserPackagesSchema.parse(params.arguments);
      const { github_pat, username, ...options } = args;
      const result = await packages.listUserPackages(github_pat, username, 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?

No annotations are provided, so the description carries full burden. It states it's a list operation, implying read-only behavior, but doesn't disclose critical traits like pagination handling (implied by parameters but not described), rate limits, authentication needs, or error conditions. The description is minimal and lacks behavioral context beyond the basic action.

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 waste. It's front-loaded and appropriately sized for the tool's complexity, though it could be more informative. Every word serves a purpose, making it highly concise.

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 no annotations and no output schema, the description is incomplete. It lacks details on return values, error handling, pagination behavior, and usage context. For a tool with 5 parameters and no structured output documentation, the description should provide more guidance to be fully helpful.

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?

Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no additional meaning beyond implying a user context for 'username'. It doesn't explain parameter interactions or provide examples. With high schema coverage, the baseline is 3, as the description doesn't compensate but doesn't detract.

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 'List packages for a user' clearly states the action (list) and resource (packages) with a scope (for a user). It distinguishes from sibling tools like 'list_org_packages' and 'list_repo_packages' by specifying user context, though it doesn't explicitly contrast them. The purpose is specific but could be more detailed about what 'packages' entails.

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 sibling tools like 'list_org_packages' or 'list_repo_packages' for different scopes, nor does it specify prerequisites or exclusions. Usage is implied by the name but not explicitly stated.

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