Analyze transitive dependencies for vulnerabilities
analyze_transitive_dependenciesWalk one or more root packages' dependency trees (e.g. a package.json "dependencies" section) up to maxDepth levels (default 2, max 3) and check every resolved package@version against OSV.dev, so vulnerabilities several levels down still surface. Read summary first; vulnerablePaths answers "which of my dependencies pulled this in"; nodes has the full graph. npm aliases are followed (actualName).
Before calling a result clean:
A node with
resolutionError(unsatisfiable range, 404, or a git/file/workspace/URL specifier) hasisVulnerable: null— it was never scanned, not clean.Only "dependencies" are followed (not dev/peer/optional). Each range is resolved independently to its max-satisfying version, so this shows which vulnerable versions are reachable, not npm's exact hoisted install.
The walk has a node budget: check
truncated/truncationNote.
Use batch_query_vulnerabilities instead when you already have a flat list of exact versions (faster, no graph walk).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxDepth | No | How many levels of transitive dependencies to expand beyond the given root packages (0 = only check the roots themselves). Default 2, capped at 3 to bound registry calls and stay within the request timeout. | |
| packages | Yes | 1-15 direct/root packages to expand from, e.g. a package.json's "dependencies". version accepts an exact version or a semver range like "^4.17.21"; omitted = latest. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodes | Yes | ||
| roots | Yes | ||
| summary | Yes | ||
| maxDepth | Yes | ||
| truncated | Yes | ||
| enrichmentNote | Yes | ||
| truncationNote | Yes | ||
| unresolvedCount | Yes | ||
| vulnerablePaths | Yes | ||
| totalPackagesScanned | Yes | ||
| totalVulnerabilities | Yes | ||
| vulnerablePackageCount | Yes |