Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_get_artifacts_summary

Retrieve summarized details of one or multiple artifacts from a repository using their full paths. Designed for quick artifact analysis and management on the JFrog MCP Server.

Instructions

Get the summary of artifacts, one or many

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsYesList of full paths of the artifacts, the full path should include the repositotiry name

Implementation Reference

  • Core handler function that queries the JFrog Xray API for artifact summaries, parses the response, aggregates issue counts by severity (Critical, High, Medium, Low, Unknown), and returns the processed summary.
    export async function getArtifactSummary(paths: GetArtifactsSummaryInput): Promise<ArtifactsSummaryOutput> {
      const full_paths = paths.paths.map(el => "default/" + el);
      const response: any = await jfrogRequest(
        "xray/api/v1/summary/artifact",
        {
          method: "POST",
          body: JSON.stringify({
            paths: full_paths,
          })
        }
      );
    
      // Debugging: Log the raw response
      console.log("Raw response from JFrog Xray API:", GetArtifactsSummaryOutputSchema.parse(response));
    
      // Validate response before parsing
      if (!response || !response.artifacts || response.artifacts.length === 0) {
        console.warn("Invalid or missing data in API response:", response);
        return { artifacts_summary: [] };
      }
    
      const apiResult =  GetArtifactsSummaryOutputSchema.parse(response);
      const severities_map = new Map<string, Array<number>>();
    
      for (const artifact of apiResult.artifacts) {
        const artifact_severities = [0, 0, 0, 0, 0];
        if (artifact.issues) {
          for (const issue of artifact.issues) {
            switch (issue.severity) {
            case "Critical":
                artifact_severities![0]++;
              break;
            case "High":
                artifact_severities![1]++;
              break;
            case "Medium":
                artifact_severities![2]++;
              break;
            case "Low":
                artifact_severities![3]++;
              break;
            case "Unknown":
                artifact_severities![4]++;
              break;
            }
          }
        }
        severities_map.set(artifact.general.path, artifact_severities);
      }
    
      const artifacts_summary = apiResult.artifacts.map((artifact) => {
        return {
          artifact_name: artifact.general.path,
          artifact_issue_count: artifact.issues ? artifact.issues.length : 0,
          artifact_critical_count: severities_map.get(artifact.general.path)![0],
          artifact_high_count: severities_map.get(artifact.general.path)![1],
          artifact_medium_count: severities_map.get(artifact.general.path)![2],
          artifact_low_count: severities_map.get(artifact.general.path)![3],
          artifact_unknown_count: severities_map.get(artifact.general.path)![4],
        };
      });
      return { artifacts_summary: artifacts_summary };
    }
  • Zod schemas for input (paths array), API output, tool output (ArtifactsSummarySchema), and related types used for validation in the jfrog_get_artifacts_summary tool.
    export const GetArtifactsSummaryOutputSchema = z.object({
      artifacts: z.array(JFrogXrayArtifactsSummarySchema).describe("List summaries of artifacts"),
      errors: z.array(JFrogXrayArtifactSummaryErrrosSchema).optional().nullable().describe("List summary errors of artifacts summary"),
    });
    
    export const GetArtifactsSummaryInputSchema = z.object({
      paths: z.array(z.string()).describe("List of full paths of the artifacts, the full path should include the repositotiry name"),
    });
    
    export const ArtifactsSummaryIssuesTLDRSchema = z.object({
      artifact_name: z.string().describe("Name of the artifact"),
      artifact_issue_count: z.number().describe("Number of issues found in the artifact"),
      artifact_critical_count: z.number().describe("Number of critical issues found in the artifact"),
      artifact_high_count: z.number().describe("Number of high issues found in the artifact"),
      artifact_medium_count: z.number().describe("Number of medium issues found in the artifact"),
      artifact_low_count: z.number().describe("Number of low issues found in the artifact"),
      artifact_unknown_count: z.number().describe("Number of unknown issues found in the artifact"),
    });
    
    export const ArtifactsSummarySchema = z.object({
      artifacts_summary: z.array(ArtifactsSummaryIssuesTLDRSchema).describe("Number of issues found in the artifacts per artifact"),
    });
    
    export type GetArtifactsSummaryInput = z.infer<typeof GetArtifactsSummaryInputSchema>;
    export type GetArtifactsSummaryOutput = z.infer<typeof GetArtifactsSummaryOutputSchema>;
    export type ArtifactsSummaryOutput = z.infer<typeof ArtifactsSummarySchema>;
  • Registers the 'jfrog_get_artifacts_summary' tool with name, description, input schema, and handler that delegates to getArtifactSummary. Exported in ArtifactSecurityTools array for inclusion in main tools list.
    const getArtifactsSummaryTool = {
      name: "jfrog_get_artifacts_summary",
      description: "Get the summary of artifacts, one or many",
      inputSchema: zodToJsonSchema(GetArtifactsSummaryInputSchema),
      //outputSchema: zodToJsonSchema(ArtifactsSummarySchema),
      handler: async (args: any) => {
        const parsedArgs = GetArtifactsSummaryInputSchema.parse(args);
        return await getArtifactSummary(parsedArgs);
      }
    };
    
    /* End of Tools creation Section */
    
    export const ArtifactSecurityTools = [
      getArtifactsSummaryTool
    ];
  • tools/index.ts:11-23 (registration)
    Imports and includes ArtifactSecurityTools (containing jfrog_get_artifacts_summary) in the main exported tools array used for MCP tool execution.
    import { ArtifactSecurityTools } from "./security.js";
    
    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, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is a read-only operation, requires authentication, has rate limits, or what the output format might be, leaving significant gaps in transparency.

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 brief and to the point with a single sentence, making it efficient. However, it could be more front-loaded with key details, and the phrase 'one or many' is somewhat redundant given the array parameter, slightly reducing impact.

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?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what a 'summary' includes, how results are returned, or any behavioral traits, making it inadequate for effective agent use despite the simple parameter schema.

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 the 'paths' parameter. The description adds no additional meaning beyond implying 'one or many' artifacts, which aligns with the array type but doesn't enhance understanding. Baseline 3 is appropriate as the schema does the heavy lifting.

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 states the action ('Get') and resource ('summary of artifacts'), but it's vague about what 'summary' entails and doesn't differentiate from siblings like jfrog_get_package_info or jfrog_get_vulnerability_info. It specifies 'one or many' artifacts, which adds some scope but remains general.

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 on when to use this tool versus alternatives is provided. The description lacks context about prerequisites, such as needing artifact paths, and doesn't mention sibling tools for comparison, leaving usage unclear.

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