Skip to main content
Glama

Rank raw `npm audit --json` output by what to fix first

enrich_npm_audit
Read-only

Given the raw output of npm audit --json (npm 7+'s {vulnerabilities: {...}} format, or legacy npm 6's {advisories: {...}}), parses it directly — no need to re-paste package.json/lockfile content — and runs it through the same remove-now/patch-now/patch-soon/scheduled/monitor ranking prioritize_remediation exposes for hand-built finding lists (an advisory that is malware — a MAL-* id, or a GHSA whose OSV record carries CWE-506 / a MAL-* alias — is auto-detected and forces remove-now). npm audit's JSON almost never includes a CVE id (only a GHSA advisory URL), so this resolves each GHSA to its CVE alias via OSV.dev when one exists (ghsaResolvedToCveCount reports how many) before doing the same CISA KEV + FIRST.org EPSS + severity scoring — skipping this step would silently degrade most findings to severity-only ranking despite prioritize_remediation being built around CVE-keyed KEV/EPSS data. Also carries through npm-audit-specific context prioritize_remediation itself has no field for: isDirect (direct vs. transitive dependency) and fixAvailable/fixTarget (npm's own computed fix — note fixTarget can name a different package than the vulnerable one, e.g. bumping a parent to pull in a patched transitive dependency). A package with more than one distinct advisory in the source report only has its first advisory used for ranking; a warning names the package so query_vulnerabilities can be called on it directly for the rest. yarn audit --json and pnpm audit --json use different report shapes and are not supported — use batch_query_vulnerabilities with the project's manifest/lockfile for those instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesRaw stdout of `npm audit --json` — either npm 7+ format ({"auditReportVersion": 2, "vulnerabilities": {...}}) or legacy npm 6 format ({"advisories": {...}}).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rankedYes
summaryYes
warningsYes
inputFormatYes
skippedCountYes
totalFindingsYes
uniqueCveCountYes
ghsaResolvedToCveCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedOutput schema / properties / ranked / items / properties / findingType
      Added value: +{
      +  "enum": [
      +    "malware",
      +    "vulnerability",
      +    "supply-chain",
      +    "install-script"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / ranked / items / properties / tier / enum
      Previous value: -[
      -  "patch-now",
      -  "patch-soon",
      -  "scheduled",
      -  "monitor"
      -]New value: +[
      +  "remove-now",
      +  "patch-now",
      +  "patch-soon",
      +  "scheduled",
      +  "monitor"
      +]
    • changedOutput schema / properties / ranked / items / required
      Previous value: -[
      -  "rank",
      -  "packageName",
      -  "cveId",
      -  "advisoryId",
      -  "advisoryTitle",
      -  "currentVersion",
      -  "fixedVersion",
      -  "severity",
      -  "kev",
      -  "epss",
      -  "score",
      -  "tier",
      -  "reason",
      -  "npmscanUrl",
      -  "cveNpmscanUrl",
      -  "isDirect",
      -  "fixAvailable",
      -  "fixTarget"
      -]New value: +[
      +  "rank",
      +  "packageName",
      +  "cveId",
      +  "advisoryId",
      +  "currentVersion",
      +  "fixedVersion",
      +  "severity",
      +  "kev",
      +  "epss",
      +  "score",
      +  "tier",
      +  "findingType",
      +  "reason",
      +  "npmscanUrl",
      +  "cveNpmscanUrl",
      +  "advisoryTitle",
      +  "isDirect",
      +  "fixAvailable",
      +  "fixTarget"
      +]
    • addedOutput schema / properties / summary / properties / removeNow
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / properties / summary / required
      Previous value: -[
      -  "patchNow",
      -  "patchSoon",
      -  "scheduled",
      -  "monitor",
      -  "kevListedCount"
      -]New value: +[
      +  "removeNow",
      +  "patchNow",
      +  "patchSoon",
      +  "scheduled",
      +  "monitor",
      +  "kevListedCount"
      +]
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, non-destructive, openWorld), and the description adds substantial behavior beyond them: GHSA→CVE resolution via OSV.dev before KEV/EPSS scoring, automatic malware detection (MAL-* / CWE-506) forcing remove-now, carry-through of `isDirect`/`fixAvailable`/`fixTarget`, and the limitation that only the first advisory per package is ranked. It also explains the consequence of skipping resolution ('would silently degrade most findings to severity-only ranking'), which is exactly the kind of non-obvious trait an agent needs.

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 purpose is front-loaded in the opening clause, and the dense parentheticals (malware detection rules, fixTarget semantics, unsupported package managers) each carry information an agent would otherwise lack. The cost is a single unbroken paragraph of run-on sentences, which hurts scanability even though little of the content is redundant.

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

Completeness5/5

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

For a tool with one input, a full output schema, and rich annotations, the description covers everything material: supported and unsupported input formats, the enrichment pipeline, the ranking buckets, the multi-advisory caveat, and fallback tools. Output values (e.g. `ghsaResolvedToCveCount`) are appropriately left to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Single required parameter with 100% schema description coverage, so the schema already documents the accepted JSON shapes and the description does not need to restate them. The description does add useful framing (the content is raw stdout, and no manifest/lockfile content is required), which is slightly more than the baseline for a fully-documented single-param tool.

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

Purpose5/5

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

States a specific verb+resource (parse raw `npm audit --json` output and rank findings for remediation) and explicitly scopes the accepted input formats (npm 7+ `{vulnerabilities}` vs legacy npm 6 `{advisories}`). It draws a precise boundary against `prioritize_remediation` ('the same ranking prioritize_remediation exposes for hand-built finding lists') and against the yarn/pnpm case, so an agent can distinguish it from every relevant sibling.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (you have raw npm audit JSON and do not want to re-paste package.json/lockfile) and when-not-to-use with the named alternative ('`yarn audit --json` and `pnpm audit --json` ... are not supported — use batch_query_vulnerabilities'). It also routes the multi-advisory-per-package case to `query_vulnerabilities`. Nothing about tool selection is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources