Skip to main content
Glama

Analyze transitive dependencies for vulnerabilities

analyze_transitive_dependencies
Read-only

Walk 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) has isVulnerable: 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

TableJSON Schema
NameRequiredDescriptionDefault
maxDepthNoHow 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.
packagesYes1-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

TableJSON Schema
NameRequiredDescriptionDefault
nodesYes
rootsYes
summaryYes
maxDepthYes
truncatedYes
enrichmentNoteYes
truncationNoteYes
unresolvedCountYes
vulnerablePathsYes
totalPackagesScannedYes
totalVulnerabilitiesYes
vulnerablePackageCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / nodes / items / properties / vulnerabilities / items / properties / isMalware
      Added value: +{
      +  "description": "Confirmed-malicious package (MAL-* id/alias or CWE-506), not an ordinary vulnerability: remove it, do not patch.",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / nodes / items / properties / vulnerabilities / items / required
      Previous value: -[
      -  "id",
      -  "summary",
      -  "severity",
      -  "aliases",
      -  "publishedAt",
      -  "fixedVersion",
      -  "npmscanUrl"
      -]New value: +[
      +  "id",
      +  "summary",
      +  "severity",
      +  "aliases",
      +  "publishedAt",
      +  "fixedVersion",
      +  "isMalware",
      +  "npmscanUrl"
      +]
  2. Changed3 schema fields changed
    • addedOutput schema / properties / nodes / items / properties / actualName
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / nodes / items / properties / isVulnerable / type
      Previous value: -"boolean"New value: +[
      +  "boolean",
      +  "null"
      +]
    • changedOutput schema / properties / nodes / items / required
      Previous value: -[
      -  "name",
      -  "version",
      -  "depth",
      -  "isRoot",
      -  "rootPackages",
      -  "parents",
      -  "npmscanUrl",
      -  "resolutionError",
      -  "isVulnerable",
      -  "highestSeverity",
      -  "vulnerabilities"
      -]New value: +[
      +  "name",
      +  "actualName",
      +  "version",
      +  "depth",
      +  "isRoot",
      +  "rootPackages",
      +  "parents",
      +  "npmscanUrl",
      +  "resolutionError",
      +  "isVulnerable",
      +  "highestSeverity",
      +  "vulnerabilities"
      +]
  3. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnly, non-destructive, openWorld), and the description adds genuinely non-obvious behavior: resolutionError nodes are unscanned rather than clean, only 'dependencies' are followed, ranges resolve independently, and a node budget can truncate the walk. One small gap: it doesn't state auth or rate-limit expectations for OSV.dev calls.

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?

Front-loaded with purpose and key caveats, and the bullet list is dense with operational warnings rather than filler. It is longer than average, but nearly every sentence carries a decision-relevant caveat, so little is wasted.

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 graph-walking tool with an output schema, the description points directly at the meaningful output fields (summary, vulnerablePaths, nodes, truncated) and pre-empts the two highest-risk misinterpretations: unscanned nodes and truncation. Nothing needed to call or correctly read it is missing.

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 coverage is 100%, so the baseline is 3, but the description adds real interpretability: it clarifies that maxDepth bounds registry calls/timeout, that nodes resolve independently rather than mirroring npm's hoisting, and that version accepts ranges. It mostly reinforces rather than extends the schema's own parameter text.

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 (walk dependency trees), resource (root packages), and external action (check against OSV.dev), plus the outcome (vulnerabilities several levels down surface). It explicitly contrasts with batch_query_vulnerabilities, so an agent can distinguish it from siblings without opening schemas.

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 an explicit alternative with the selecting condition: 'Use batch_query_vulnerabilities instead when you already have a flat list of exact versions (faster, no graph walk).' It also directs how to consume results, telling the agent to read summary first and use vulnerablePaths for the 'which dependency pulled this in' question.

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