Skip to main content
Glama

Diff two package.json/lockfile snapshots

diff_dependencies
Read-only

Compares two raw snapshots of a package.json, package-lock.json (npm v1-v3), yarn.lock (classic v1 or Berry), or pnpm-lock.yaml — e.g. before/after a PR — and reports which packages were added, removed, or version-bumped. For every added or bumped package (up to 100 per call), also checks whether its resolved version carries a preinstall/install/postinstall/prepare lifecycle script that the before-version did NOT have (installScriptIntroduced, the highest-signal field here — a routine-looking patch bump quietly adding a postinstall is exactly the shape of a compromised-maintainer supply-chain attack) and batch-checks it against OSV.dev, reporting vulnerabilityDelta (introduced/fixed/still-vulnerable/still-clean) rather than just a bare isVulnerable flag. Scope notes: only direct dependencies are diffed for package.json/package-lock.json/pnpm-lock.yaml (their own formats distinguish direct from transitive); yarn.lock has no such distinction, so its side of the diff covers every resolved package in the file — expect a larger added/removed count when diffing a yarn.lock, and check comparisonNote when the two snapshots are different formats. The install-script check is presence-only (read from the registry packument or lockfile metadata, not a tarball content scan) — use analyze_install_script for a deep-dive on anything flagged here. Ideal for a CI gate reviewing a dependency-changing PR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterYesRaw file content of the "after" snapshot — a package.json, package-lock.json (npm v1-v3), yarn.lock (classic v1 or Berry), or pnpm-lock.yaml. Format is auto-detected; before/after may be different formats.
beforeYesRaw file content of the "before" snapshot — a package.json, package-lock.json (npm v1-v3), yarn.lock (classic v1 or Berry), or pnpm-lock.yaml. Format is auto-detected; before/after may be different formats.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
addedYes
changedYes
removedYes
summaryYes
truncatedYes
totalAddedYes
afterFormatYes
beforeFormatYes
flaggedCountYes
totalChangedYes
totalRemovedYes
comparisonNoteYes
enrichmentNoteYes
truncationNoteYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/openWorld/non-destructive, and the description adds substantial behavioral context: the 100-package cap, installScriptIntroduced semantics, vulnerabilityDelta value set, presence-only install-script detection, and format-scope differences. This goes well beyond what annotations convey.

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

Conciseness5/5

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

The description is dense but every sentence carries meaningful guidance: core operation, high-signal output fields, scope caveats, detection limitations, and alternative tool. It is front-loaded with the primary purpose and uses the remaining length for genuinely necessary nuances.

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, the presence of an output schema, and full annotation coverage, the description is complete: it covers format variants, scope limitations, batch behavior, vulnerability reporting style, mixed-format handling, and the recommended next step for flagged results. No critical calling context is missing.

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?

Both parameters are fully documented in the input schema (100% coverage), including raw content, allowed formats, and auto-detection. The description reinforces the before/after relationship and PR use case, but does not add new parameter-level semantics beyond what the schema already provides.

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: 'Compares two raw snapshots of ... package.json ... and reports which packages were added, removed, or version-bumped.' It clearly distinguishes this from siblings like analyze_install_script by framing it as a before/after dependency diff tool.

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?

It states the intended context ('e.g. before/after a PR'), recommends it as 'Ideal for a CI gate reviewing a dependency-changing PR,' and explicitly directs the agent to analyze_install_script for deep-dives. It also gives format-specific guidance about yarn.lock vs. direct-dependency diffing and the comparisonNote for mixed formats.

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.

TDQS

A4.4/5.0
Disambiguation4/5

Most tools target a distinct part of the supply-chain lifecycle, and the detailed descriptions include explicit cross-references that reduce misselection. The main ambiguity is among the vulnerability-lookup tools—especially get_latest_advisories and get_cve, which both accept CVE IDs, and query_vulnerabilities versus batch_query_vulnerabilities, which differ mainly in input shape.

Naming Consistency5/5

Every tool name uses lowercase snake_case with a leading imperative verb or verb phrase: analyze_, audit_, batch_query_, check_, compare_, diff_, get_, prioritize_, query_, search_, and suggest_. The check_* tools form a consistent sub-family, and there are no camelCase or noun-only strays.

Tool Count4/5

18 tools is on the high side, so the server feels slightly heavy rather than lean. However, the domain is broad enough that each tool occupies a meaningful workflow step—metadata lookup, vulnerability querying, transitive analysis, license/maintainer/provenance checks, repo auditing, diffing, and remediation—so the count is still reasonable for a comprehensive npm security server.

Completeness5/5

The surface covers the full npm supply-chain audit workflow: discovery, exact-version and lockfile vulnerability checks, transitive dependency resolution, install-script deep scans, license compliance, maintainer and provenance history, repo-level audits, dependency diffs, remediation prioritization, and alternative suggestions. There are no obvious dead ends, and the tools consistently point to natural follow-up actions.

Resources