Skip to main content
Glama

get_user_package

Retrieve a user's package from GitHub by specifying username, package type (npm, maven, docker, etc.), and package name to access package information.

Instructions

Get a package for a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesUsername
package_typeYesThe type of package
package_nameYesThe name of the package

Implementation Reference

  • Core handler function that performs the GitHub API request to fetch a specific package for a user and validates the response using PackageSchema.
    export async function getUserPackage(
      github_pat: string,
      username: 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/users/${username}/packages/${package_type}/${package_name}`
      );
      return PackageSchema.parse(response);
    }
  • Input schemas for the get_user_package tool: public schema and internal extended schema including github_pat.
    export const GetUserPackageSchema = z.object({
      username: z.string().describe("Username"),
      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 _GetUserPackageSchema = GetUserPackageSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • Output schema used by the handler to parse the GitHub API response for package details.
    export const PackageSchema = z.object({
      id: z.number(),
      name: z.string(),
      package_type: z.string(),
      owner: GitHubIssueAssigneeSchema.optional(),
      version_count: z.number().optional(),
      visibility: z.string(),
      url: z.string(),
      created_at: z.string(),
      updated_at: z.string(),
      html_url: z.string(),
      versions_url: z.string().optional(),
      repository_url: z.string().optional(),
    });
  • src/index.ts:296-299 (registration)
    Tool registration in the listTools response, defining name, description, and input schema.
      name: "get_user_package",
      description: "Get a package for a user",
      inputSchema: zodToJsonSchema(packages.GetUserPackageSchema),
    },
  • src/index.ts:767-774 (registration)
    Dispatch handler in the switch statement that parses arguments and calls the getUserPackage function.
    case "get_user_package": {
      const args = packages._GetUserPackageSchema.parse(params.arguments);
      const { github_pat, username, package_type, package_name } = args;
      const result = await packages.getUserPackage(github_pat, username, package_type, package_name);
      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. It states 'Get a package' but doesn't clarify if this is a read-only operation, what data is returned (e.g., metadata, download link), error conditions, or rate limits. This is a significant gap for a tool with three required parameters and no output schema.

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—'Get a package for a user' is front-loaded and appropriately sized for the tool's apparent complexity. Every word contributes to the core purpose without redundancy.

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, no output schema, and three required parameters, the description is incomplete. It doesn't cover behavioral aspects like return values, error handling, or usage context, leaving gaps that could hinder an AI agent's ability to invoke the tool correctly in complex scenarios.

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%, with clear parameter descriptions and an enum for 'package_type'. The description adds no meaning beyond the schema—it doesn't explain parameter relationships, constraints, or examples. Baseline 3 is appropriate as the schema does the heavy lifting, but no extra value is added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get a package for a user' states a clear verb ('Get') and resource ('package'), but it's vague about what 'Get' entails (e.g., retrieve metadata, download, list versions) and doesn't distinguish from siblings like 'get_org_package' or 'get_repo_package', which target different scopes. It avoids tautology by not merely restating the name.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_org_package' or 'list_user_packages'. The description implies usage for a specific user's package but doesn't specify prerequisites, exclusions, or contextual triggers, leaving the agent to infer based on parameter names 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