Skip to main content
Glama

Batch query known vulnerabilities

batch_query_vulnerabilities
Read-only

Query OSV.dev for known vulnerabilities across a whole npm dependency inventory at once: either pass a flat {packages:[...]} list, or paste raw package.json / lockfile / CycloneDX JSON / SPDX JSON content via content. The tool normalizes npm dependencies first, then chunk-queries OSV behind the scenes so large SBOMs don't stop at the upstream 100-package batch limit. Each finding includes severity, a summary, CVE aliases, and the fixed version — not just a bare advisory ID — so a dependency audit answer doesn't need a follow-up call per flagged package. For an explicit packages list or raw package.json content — names that were never actually resolved against a registry, unlike a real lockfile/SBOM — package names are also cross-checked against the npm registry (capped at 200 unique names): a name that doesn't exist there would otherwise show a silent, indistinguishable vulnerabilityCount: 0 — see unresolvedPackages/existenceCheckNote and do not read those entries as a clean bill of health. A packages[].version that doesn't currently appear on the registry (a typo'd/fabricated version, OR a real version that was published and later removed, e.g. unpublished for containing malware) is cross-checked the same way — see nonexistentVersions; don't assume it never existed, and don't assume vulnerabilityCount:0 for it means clean, since OSV can still carry findings for a version the registry no longer lists. A packages[] entry given with NO version at all (e.g. {name:"react"}) is intentionally queried unversioned against OSV — this returns advisories affecting ANY historical published version of that package, not just the latest or whatever a project actually has installed; see the corresponding warnings entry naming which packages this applied to, and don't report "package X is vulnerable" from an unversioned result without separately confirming against the specific version in use (get_package/get_package_version). Each result also carries signals (deprecated, hasInstallScripts for the specific requested/resolved version, popularityTier/maintenanceTier, and possibleTyposquatOf — same deterministic rule-based labels as get_package/search_packages, capped at the same 200 unique names): a clean vulnerabilityCount:0 does NOT mean safe to use if signals flags a likely typosquat, an abandoned/stale package, or a deprecation notice — surface those explicitly rather than reporting only the vulnerability count. signals is null for a scanStatus: "not-scanned" entry, deliberately — a git/file/workspace/URL dependency can be declared under a name that collides with a real npm package (e.g. a git dependency literally named "lodash"), and that unrelated public package's popularity/maintenance signals must not be attached to it just because the name happens to resolve on the registry. A lockfile-resolved result also carries source (resolvedUrl/integrity straight from that lockfile entry, plus nonRegistryHost): nonRegistryHost: true means the tarball URL points somewhere other than the expected npm/yarn registry host — e.g. a compromised mirror or a hand-edited lockfile — which a name+version match against OSV cannot detect on its own, since a malicious tarball can share the same name/version as the real package and carry zero OSV findings. source is null when the input format doesn't record this (package.json content, an explicit packages entry, or pnpm-lock, which never records a resolvedUrl). nonRegistryHost: false alone is NOT proof the tarball is correct — source.identityMismatch: true catches a SAME-HOST swap that host-checking cannot: a lockfile entry can declare e.g. "lodash@4.18.1" while resolvedUrl actually points at the real registry.npmjs.org's own tarball for a completely different package/version, and vulnerabilityCount above was still computed for the DECLARED name/version, not whatever that resolved tarball actually is — treat identityMismatch: true as a lockfile-tamper finding, not a cosmetic mismatch, and see source.resolvedName/resolvedVersion for what the tarball actually names. vulnerabilityCount/advisoryCount are raw OSV/GHSA advisory counts and can over-count: OSV sometimes publishes more than one advisory record for the same underlying CVE — use uniqueVulnerabilityCount (deduped by shared CVE alias) when reporting 'how many distinct issues' rather than a raw advisory tally. When content is itself a package.json (not a lockfile/SBOM), projectLifecycleScripts surfaces that SCANNED PROJECT's own preinstall/install/postinstall/prepare scripts, if any — these run arbitrary code the moment someone runs npm install on the project itself, separate from anything a dependency does, and 'scan my package.json' should not silently skip the one script that actually executes for the project being scanned. An npm alias (e.g. "totally-safe": "npm:minimist@0.0.8") is followed to its real target in every input format — results[i].package.actualName names the real package that vulnerability/signal data attaches to (.name stays the declared/alias key); this is NOT silently skipped, since doing so would let a vulnerable package hide behind whatever name a project calls it. A dependency whose spec points somewhere other than the registry (git/file/workspace/URL) or that never resolved to a version is excluded from vulnerability querying entirely rather than queried by name alone — vulnerabilityCount: 0 for one of these would otherwise misleadingly attach an unrelated public npm package's entire vulnerability history to it. When content is a package.json, peerDependencies are excluded from scanning by default (a peer is often intentionally left unresolved by the consumer) — see ignoredPeerDependencyNames, and pass includePeerDependencies: true to also check them, since a vulnerable/malicious peerDependency is otherwise invisible to this scan. results[i].package.declaredSpec is set whenever .version was RESOLVED from a package.json semver range/tag (e.g. "^18.2.0" -> "18.2.0") rather than being an already-exact pin or a lockfile-derived version — a range can silently pick up a new, possibly-compromised release the next time this project is installed, while an exact pin can't, so don't treat a range-resolved isVulnerable:false as equally durable to a pinned one just because they look identical today.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNoRaw dependency inventory content: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, CycloneDX JSON, or SPDX JSON. Use this OR `packages`, not both.
packagesNoExplicit package list (1-1000 items). Use this OR `content`, not both.
includeDevDependenciesNoIgnored when using `packages`; only applies when `content` is a manifest/lockfile format that distinguishes dev dependencies.
includePeerDependenciesNoIgnored when using `packages`; only applies when `content` is a package.json. peerDependencies are excluded from scanning by default (see ignoredPeerDependencyNames) since a peer is often intentionally left unresolved by the consumer — set this to also check them.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYes
warningsNo
inputFormatNo
ignoredCountNo
enrichmentNoteNo
queryFailureCountNo
existenceCheckNoteNo
parsedPackageCountNo
unresolvedPackagesNo
nonexistentVersionsNo
totalVulnerabilitiesYes
projectLifecycleScriptsNo
ignoredPeerDependencyNamesNo
projectLifecycleScriptRiskNo
totalUniqueVulnerabilitiesYes
packagesWithVulnerabilitiesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / results / items / properties / source / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "integrity": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "nonRegistryHost": {
      -        "type": [
      -          "boolean",
      -          "null"
      -        ]
      -      },
      -      "resolvedUrl": {
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "resolvedUrl",
      -      "integrity",
      -      "nonRegistryHost"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "identityMismatch": {
      +        "type": [
      +          "boolean",
      +          "null"
      +        ]
      +      },
      +      "integrity": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "nonRegistryHost": {
      +        "type": [
      +          "boolean",
      +          "null"
      +        ]
      +      },
      +      "resolvedName": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "resolvedUrl": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "resolvedVersion": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "resolvedUrl",
      +      "integrity",
      +      "nonRegistryHost",
      +      "identityMismatch",
      +      "resolvedName",
      +      "resolvedVersion"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / results / items / properties / source
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "integrity": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "nonRegistryHost": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "resolvedUrl": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "resolvedUrl",
      +        "integrity",
      +        "nonRegistryHost"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "package",
      -  "npmscanUrl",
      -  "scanStatus",
      -  "vulnerabilityCount",
      -  "advisoryCount",
      -  "uniqueVulnerabilityCount",
      -  "vulnerabilities",
      -  "signals"
      -]New value: +[
      +  "package",
      +  "npmscanUrl",
      +  "scanStatus",
      +  "vulnerabilityCount",
      +  "advisoryCount",
      +  "uniqueVulnerabilityCount",
      +  "vulnerabilities",
      +  "signals",
      +  "source"
      +]
  3. Changed7 schema fields changed
    • addedInput schema / properties / includePeerDependencies
      Added value: +{
      +  "description": "Ignored when using `packages`; only applies when `content` is a package.json. peerDependencies are excluded from scanning by default (see ignoredPeerDependencyNames) since a peer is often intentionally left unresolved by the consumer — set this to also check them.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / ignoredPeerDependencyNames
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / projectLifecycleScriptRisk
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "hasLifecycleScripts": {
      +      "type": "boolean"
      +    },
      +    "riskTier": {
      +      "enum": [
      +        "none",
      +        "low",
      +        "moderate",
      +        "high",
      +        "critical"
      +      ],
      +      "type": "string"
      +    },
      +    "totalScore": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "hasLifecycleScripts",
      +    "riskTier",
      +    "totalScore"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / results / items / properties / package / properties / actualName
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / package / properties / declaredSpec
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / results / items / properties / scanStatus
      Added value: +{
      +  "enum": [
      +    "scanned",
      +    "not-scanned"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "package",
      -  "npmscanUrl",
      -  "vulnerabilityCount",
      -  "advisoryCount",
      -  "uniqueVulnerabilityCount",
      -  "vulnerabilities",
      -  "signals"
      -]New value: +[
      +  "package",
      +  "npmscanUrl",
      +  "scanStatus",
      +  "vulnerabilityCount",
      +  "advisoryCount",
      +  "uniqueVulnerabilityCount",
      +  "vulnerabilities",
      +  "signals"
      +]
  4. Changed9 schema fields changed
    • addedInput schema / properties / packages / items / properties / version / description
      Added value: +"One exact published version, e.g. \"18.2.0\" (not a range/tag like \"^18.2.0\" or \"latest\" — those are resolved against the registry first, at the cost of an extra lookup, rather than rejected)"
    • addedOutput schema / properties / nonexistentVersions
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / projectLifecycleScripts
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / results / items / properties / advisoryCount
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / results / items / properties / signals
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "deprecated": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "hasInstallScripts": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "maintenanceTier": {
      +          "enum": [
      +            "active",
      +            "aging",
      +            "stale",
      +            "unknown"
      +          ],
      +          "type": "string"
      +        },
      +        "popularityTier": {
      +          "enum": [
      +            "very-high",
      +            "high",
      +            "moderate",
      +            "low",
      +            "very-low",
      +            "unknown"
      +          ],
      +          "type": "string"
      +        },
      +        "possibleTyposquatOf": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "name": {
      +                  "type": "string"
      +                },
      +                "rank": {
      +                  "type": "number"
      +                }
      +              },
      +              "required": [
      +                "name",
      +                "rank"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "required": [
      +        "deprecated",
      +        "hasInstallScripts",
      +        "popularityTier",
      +        "maintenanceTier",
      +        "possibleTyposquatOf"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • addedOutput schema / properties / results / items / properties / uniqueVulnerabilityCount
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / properties / results / items / required
      Previous value: -[
      -  "package",
      -  "npmscanUrl",
      -  "vulnerabilityCount",
      -  "vulnerabilities"
      -]New value: +[
      +  "package",
      +  "npmscanUrl",
      +  "vulnerabilityCount",
      +  "advisoryCount",
      +  "uniqueVulnerabilityCount",
      +  "vulnerabilities",
      +  "signals"
      +]
    • addedOutput schema / properties / totalUniqueVulnerabilities
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "results",
      -  "totalVulnerabilities",
      -  "packagesWithVulnerabilities"
      -]New value: +[
      +  "results",
      +  "totalVulnerabilities",
      +  "totalUniqueVulnerabilities",
      +  "packagesWithVulnerabilities"
      +]
  5. Changed2 schema fields changed
    • addedOutput schema / properties / existenceCheckNote
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / unresolvedPackages
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  6. Changed3 schema fields changed
    • changedInput schema / properties / content / description
      Previous value: -"Optional raw dependency inventory content: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, CycloneDX JSON, or SPDX JSON."New value: +"Raw dependency inventory content: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, CycloneDX JSON, or SPDX JSON. Use this OR `packages`, not both."
    • changedInput schema / properties / includeDevDependencies / description
      Previous value: -"Only applies when `content` is a package manifest/lockfile format that can distinguish dev dependencies. Default false."New value: +"Ignored when using `packages`; only applies when `content` is a manifest/lockfile format that distinguishes dev dependencies."
    • changedInput schema / properties / packages / description
      Previous value: -"Optional explicit package list (1-1000 items). Use this OR `content`, not both."New value: +"Explicit package list (1-1000 items). Use this OR `content`, not both."
  7. Changed10 schema fields changed
    • addedInput schema / properties / content
      Added value: +{
      +  "description": "Optional raw dependency inventory content: package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, CycloneDX JSON, or SPDX JSON.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / includeDevDependencies
      Added value: +{
      +  "description": "Only applies when `content` is a package manifest/lockfile format that can distinguish dev dependencies. Default false.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / packages / description
      Previous value: -"1-100 packages to check"New value: +"Optional explicit package list (1-1000 items). Use this OR `content`, not both."
    • changedInput schema / properties / packages / maxItems
      Previous value: -100New value: +1000
    • removedInput schema / required
      Removed value: -[
      -  "packages"
      -]
    • addedOutput schema / properties / ignoredCount
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / inputFormat
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / parsedPackageCount
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / queryFailureCount
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  8. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "enrichmentNote": {
      +      "type": "string"
      +    },
      +    "packagesWithVulnerabilities": {
      +      "type": "number"
      +    },
      +    "results": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "npmscanUrl": {
      +            "type": "string"
      +          },
      +          "package": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "name": {
      +                "type": "string"
      +              },
      +              "version": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "name"
      +            ],
      +            "type": "object"
      +          },
      +          "vulnerabilities": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "aliases": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "fixedVersion": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "id": {
      +                  "type": "string"
      +                },
      +                "npmscanUrl": {
      +                  "type": "string"
      +                },
      +                "publishedAt": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "severity": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                },
      +                "summary": {
      +                  "type": [
      +                    "string",
      +                    "null"
      +                  ]
      +                }
      +              },
      +              "required": [
      +                "id",
      +                "summary",
      +                "severity",
      +                "aliases",
      +                "publishedAt",
      +                "fixedVersion",
      +                "npmscanUrl"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "vulnerabilityCount": {
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "package",
      +          "npmscanUrl",
      +          "vulnerabilityCount",
      +          "vulnerabilities"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "totalVulnerabilities": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "results",
      +    "totalVulnerabilities",
      +    "packagesWithVulnerabilities"
      +  ],
      +  "type": "object"
      +}
  9. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description goes far beyond annotations: it discloses chunked querying behind the scenes, npm registry cross-checking with caps, silent-zero pitfalls, unversioned query semantics, signals null behavior, source/identityMismatch tamper detection, alias following, peerDependency exclusion, and advisory over-counting. This is exceptionally rich behavioral disclosure.

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

Conciseness3/5

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

The description is extremely long and dense, with many clauses packed into single sentences. It is front-loaded with the core purpose, but the sheer volume of caveats and edge cases makes it hard to parse. Every sentence earns its place in terms of content value, but the structure is not concise; it reads as a wall of text rather than a scannable definition.

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?

Given the tool's complexity (4 params, 100% schema coverage, output schema present, 20 siblings), the description is remarkably complete. It covers input formats, output fields, edge cases, security implications, and cross-tool routing. Nothing an agent needs to call this correctly is missing; the output schema handles return-value documentation.

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?

Schema description coverage is 100%, so the schema already documents all four parameters. The description adds substantial meaning beyond the schema: it explains the content formats, the packages/version semantics (unversioned queries, range resolution), the includePeerDependencies default behavior, and the includeDevDependencies scope. It doesn't add much about the boolean parameters beyond what the schema says, but the coverage is already complete.

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?

The description opens with a specific verb and resource ('Query OSV.dev for known vulnerabilities across a whole npm dependency inventory at once') and immediately distinguishes the batch mode from single-package alternatives. It names the two input modes (packages list or raw content) and the sibling tool query_vulnerabilities is implicitly differentiated by the batch/inventory framing.

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?

The description gives explicit when-to-use guidance: batch inventory scanning vs single-package queries, and repeatedly tells the agent what NOT to do (don't read vulnerabilityCount:0 as clean for unresolved names, don't report unversioned results as vulnerable, don't treat range-resolved as durable). It also names the sibling get_package/get_package_version for confirmation and query_vulnerabilities for single-package queries.

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