Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_get_package_info

Retrieve public details about a software package, including its description, latest version, license, repository links, homepage, and malicious status. Supported types: PyPI, npm, Maven, Golang, NuGet, Huggingface, RubyGems.

Instructions

Useful for when you need to get publicly available information about a software package. it will provide you with the following information on it, if available in public sources: a short description of the package, its latest published version, the software license this software is distributed under, along with urls of its version control system, its homepage and whether it is known to be a malicious package (in any version).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the package, as it appears in the package repository.
typeYesThe type of package.
versionNoThe version of the package, as it appears in the package repository. Default value is 'latest'.latest

Implementation Reference

  • The core handler function `getPackageInfo` that constructs a GraphQL query to fetch package details from JFrog Catalog API, processes the response including license and security info, and returns the formatted package information.
    export async function getPackageInfo(options: { 
        type: string; 
        name: string; 
        version?: string;
    }) {
      const packageVersion = !options.version || options.version.trim().toLowerCase() === "latest" 
        ? "latest" 
        : options.version;
    
      const isLatestVersion = packageVersion === "latest";
    
      const query = `query GetCatalogPackageEntity(
            $type: String!, 
            $name: String!
            ${!isLatestVersion ? ", $version: String!" : ""}
        ) {
            package(type: $type, name: $name) {
                name
                description
                vcsUrl
                homepage
                latestVersion {
                    version
                    published
                    licenseInfo {
                        expression
                    }
                }
                ${isLatestVersion ? `
                    licenseInfo {
                        expression
                    }
                ` : `
                    versions(first: 1, where: { version: $version }) {
                        edges {
                            node {
                                version
                                published
                                licenseInfo {
                                    expression
                                }
                            }
                        }
                    }
                `}
                securityInfo {
                    maliciousInfo {
                        knownToBeMalicious
                    }
                }
            }
        }`;
    
      const variables = {
        type: options.type,
        name: options.name,
        ...((!isLatestVersion && options.version) ? { version: options.version } : {})
      };
    
      function processResponse(response: unknown) {
        const validatedResponse = JFrogCatalogGraphQLResponseSchema.parse(response);
        if (!validatedResponse.data?.package) {
          throw new Error("Package information not found in Catalog.");
        }
    
        const packageData = validatedResponse.data.package;
            
        // Process license information for latest version
        if (isLatestVersion && packageData.licenseInfo?.expression) {
          const topLevelLicenseExpression = packageData.licenseInfo.expression;
          const latestVersionLicenseExpression = packageData.latestVersion?.licenseInfo?.expression;
    
          if (latestVersionLicenseExpression && latestVersionLicenseExpression !== topLevelLicenseExpression) {
            console.warn(
              `Package.license value is different from Package.latestVersion.license value. ` +
                        `Package.license: ${topLevelLicenseExpression}, ` +
                        `Package.latestVersion.license: ${latestVersionLicenseExpression}. ` +
                        `Using Package.license as the source of truth.`
            );
          }
    
          packageData.latestVersion = packageData.latestVersion || {
            version: "",
            published: "",
            licenseInfo: { expression: topLevelLicenseExpression }
          };
          delete packageData.licenseInfo;
        }
    
        // Process specific version information
        if (!isLatestVersion && packageData.versions?.edges?.[0]?.node) {
          packageData.version = packageData.versions.edges[0].node;
          delete packageData.versions;
        }
    
        // Handle potentially null securityInfo more gracefully
        const finalResult = {
          ...packageData,
          isMalicious: packageData.securityInfo && 
                             typeof packageData.securityInfo === "object" && 
                             packageData.securityInfo.maliciousInfo && 
                             typeof packageData.securityInfo.maliciousInfo === "object" && 
                             "knownToBeMalicious" in packageData.securityInfo.maliciousInfo ? 
            Boolean(packageData.securityInfo.maliciousInfo.knownToBeMalicious) : 
            false
        };
            
        delete finalResult.securityInfo;
        return finalResult;
      }
    
      const processedData = await jfrogRequest(
        "xray/catalog/graphql",
        {
          method: "POST",
          body: JSON.stringify({ query, variables })
        },
        processResponse
      );
    
      return processedData;
    }
  • Zod schema definitions for the tool input: base package schema and extended version schema used for input validation.
    export const JFrogCatalogPackageSchema = z.object({
      type: z.enum(JFrogCatalogSupportedPackageTypes).describe("The type of package."),
      name: z.string().describe("The name of the package, as it appears in the package repository.")
    });
    
    export const JFrogCatalogPackageVersionSchema = JFrogCatalogPackageSchema.extend({
      version: z.string().default("latest").describe("The version of the package, as it appears in the package repository. Default value is 'latest'.")
    });
  • Tool registration object defining name, description, input schema, and handler wrapper that parses args and calls getPackageInfo.
    const getCatalogPackageEntityTool = {
      name: "jfrog_get_package_info",
      description: "Useful for when you need to get publicly available information about a software package. " +
            "it will provide you with the following information on it, if available in public sources: " +
            "a short description of the package, its latest published version, the software license " +
            "this software is distributed under, along with urls of its version control system, " +
            "its homepage and whether it is known to be a malicious package (in any version).",
      inputSchema: zodToJsonSchema(JFrogCatalogPackageVersionSchema),
      //outputSchema: zodToJsonSchema(JFrogCatalogPackageVersionSchema),
      handler: async (args: any) => {
        const parsedArgs = JFrogCatalogPackageVersionSchema.parse(args);
        return await getPackageInfo(parsedArgs);
      }
    };
  • tools/index.ts:13-23 (registration)
    Main tools array registration where CatalogTools (including jfrog_get_package_info) is spread into the global tools list.
    export const tools =[
      ...RepositoryTools,
      ...BuildsTools,
      ...RuntimeTools,
      ...AccessTools,
      ...AQLTools,
      ...CatalogTools,
      ...CurationTools,
      ...PermissionsTools,
      ...ArtifactSecurityTools,
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool retrieves 'publicly available information' and lists return fields, but doesn't mention potential limitations like rate limits, authentication requirements, error conditions, or whether it's a read-only operation. For a tool with no annotations, this leaves significant behavioral gaps unaddressed.

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

Conciseness4/5

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

The description is efficiently structured in two sentences: one stating the purpose and context, another listing the specific information returned. It's appropriately sized for the tool's complexity and front-loads the core purpose. Minor grammatical issues ('it will provide' could be 'provides') don't significantly impact clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description provides adequate but incomplete context. It clearly states what information is returned but doesn't cover behavioral aspects like error handling or performance characteristics. Without annotations or output schema, the description should ideally provide more operational context for a tool that interacts with external package repositories.

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%, providing clear documentation for all three parameters. The description doesn't add any parameter-specific information beyond what's in the schema. It mentions 'package' generally but doesn't clarify parameter relationships or usage patterns. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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 tool's purpose: 'get publicly available information about a software package' and lists specific data points returned. It distinguishes from siblings like jfrog_get_package_versions or jfrog_get_package_version_vulnerabilities by focusing on general package metadata rather than version-specific details. However, it doesn't explicitly contrast with jfrog_get_package_curation_status, which might overlap in some contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context with 'when you need to get publicly available information about a software package' and lists what information is provided. However, it doesn't explicitly state when to use this tool versus alternatives like jfrog_get_package_versions (for version lists) or jfrog_get_package_curation_status (for curation status). The guidance is present but not comprehensive regarding sibling differentiation.

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

Related 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/jfrog/mcp-jfrog'

If you have feedback or need assistance with the MCP directory API, please join our Discord server