Skip to main content
Glama

Lockfile malware check (free, whole tree)

check_lockfile
Read-onlyIdempotent

Check EXACTLY-PINNED npm dependencies against published malicious-package advisories (OSV/OpenSSF). Free, anonymous, one call for the whole set. Give EITHER lockfile, the full text of a package-lock.json, yarn.lock or pnpm-lock.yaml, OR packages, a list of "name@version" strings, which is the one to reach for when you only care about a few dependencies or when an 800-package tree would not fit in your context. Give one or the other, never both. Only exact versions can be answered: a range like ^5.0.0 has no definitive answer because a compromised release usually sits between clean ones. Fail-closed: anything that could not be checked is returned in unverified, so an empty malicious list is an all-clear only when unverified is empty too AND truncated is false. truncated: true means the lockfile ran past the per-request package limit and the packages past it went into NEITHER list: they were never looked at, checked counts only the ones that were, and the rest are unchecked rather than clean. When that happens, send the remainder as packages (name@version strings) in a second call, or split the lockfile by workspace, before telling anyone the tree is clean.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check_lockfile"
  }
}

Input Schema

NameRequiredDescriptionDefault
lockfileNoThe full text contents of a package-lock.json, yarn.lock, or pnpm-lock.yaml.
packagesNoExactly pinned packages, as "name@version" strings (for example ["chalk@5.6.1","debug@4.4.2"]). Use instead of `lockfile` when you know which dependencies you care about, so a whole tree need not pass through your context. Mutually exclusive with `lockfile`.

Output Schema

NameRequiredDescriptionDefault
noteNo
formatNoLockfile format detected.
checkedYesHow many exactly pinned versions were actually checked.
skippedNoEntries with no registry identity (file:, link:, workspace:, git:).
maliciousYesPinned versions listed as malware in the advisory corpus. Act on these.
truncatedNoTrue when the lockfile ran past the per-request package limit. The packages past it are in neither `malicious` nor `unverified`: they were never checked. Send them as `packages` in another call.
disclaimerNo
unverifiedYesCould NOT be decided. Never treat these as clean.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedOutput schema / properties / skipped / properties
      Added value: +{
      +  "count": {
      +    "type": "integer"
      +  },
      +  "reason": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / skipped / required
      Added value: +[
      +  "count",
      +  "reason"
      +]
    • changedOutput schema / properties / skipped / type
      Previous value: -"integer"New value: +"object"
  2. Changed4 schema fields changed
    • addedInput schema / properties / packages
      Added value: +{
      +  "description": "Exactly pinned packages, as \"name@version\" strings (for example [\"chalk@5.6.1\",\"debug@4.4.2\"]). Use instead of `lockfile` when you know which dependencies you care about, so a whole tree need not pass through your context. Mutually exclusive with `lockfile`.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "lockfile"
      -]
    • changedOutput schema / description
      Previous value: -"Fail closed: an empty `malicious` list is an all-clear ONLY when `unverified` is also empty."New value: +"Fail closed: an empty `malicious` list is an all-clear ONLY when `unverified` is also empty AND `truncated` is false. Packages past the per-request limit appear in no list at all."
    • addedOutput schema / properties / truncated / description
      Added value: +"True when the lockfile ran past the per-request package limit. The packages past it are in neither `malicious` nor `unverified`: they were never checked. Send them as `packages` in another call."
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Fail closed: an empty `malicious` list is an all-clear ONLY when `unverified` is also empty.",
      +  "properties": {
      +    "checked": {
      +      "description": "How many exactly pinned versions were actually checked.",
      +      "type": "integer"
      +    },
      +    "disclaimer": {
      +      "type": "string"
      +    },
      +    "format": {
      +      "description": "Lockfile format detected.",
      +      "type": "string"
      +    },
      +    "malicious": {
      +      "description": "Pinned versions listed as malware in the advisory corpus. Act on these.",
      +      "items": {
      +        "properties": {
      +          "ids": {
      +            "description": "Advisory ids, for example MAL-2025-46969.",
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "version": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "version"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "skipped": {
      +      "description": "Entries with no registry identity (file:, link:, workspace:, git:).",
      +      "type": "integer"
      +    },
      +    "truncated": {
      +      "type": "boolean"
      +    },
      +    "unverified": {
      +      "description": "Could NOT be decided. Never treat these as clean.",
      +      "items": {
      +        "properties": {
      +          "name": {
      +            "type": "string"
      +          },
      +          "reason": {
      +            "type": "string"
      +          },
      +          "version": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "version"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "checked",
      +    "malicious",
      +    "unverified"
      +  ],
      +  "type": "object"
      +}
  4. Added

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations, which only declare read-only/idempotent/non-destructive/open-world. The description discloses the fail-closed contract, the existence and meaning of `unverified`, `truncated`, and `checked`, the per-request package limit, and the crucial caveat that an empty `malicious` list is only an all-clear when `unverified` is empty and `truncated` is false.

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 the mode-choice rule before the fail-closed details. Dense and mostly waste-free, though the closing truncation paragraph restates the 'unchecked rather than clean' point twice and could be tightened.

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 two-mode, open-world lookup with an output schema, the description covers everything needed to call it safely: input format, exclusivity, the exact-version constraint, and how to interpret partial results. Nothing material is missing for correct invocation or interpretation.

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds real meaning: mutual exclusivity ('never both'), the context-window tradeoff that decides between `lockfile` and `packages`, and the rationale that only exact pins are answerable because a compromised release usually sits between clean ones. That is semantics an agent cannot get from the schema alone.

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

Purpose4/5

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

Specific verb and resource: checks exactly-pinned npm dependencies against malicious-package advisories (OSV/OpenSSF), with scope qualifiers ('free, anonymous, one call for the whole set') that hint at a lightweight complement to a deeper scan. It never names the close sibling `scan_lockfile_deep`, so an agent must infer the boundary from the 'free / one call' framing rather than being told.

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

Usage Guidelines4/5

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

Explicit guidance on the two modes: use `lockfile` for a whole tree, `packages` when you only care about a few dependencies or the tree would not fit in context, and 'Give one or the other, never both.' It also prescribes the recovery action on truncation (resend the remainder as `packages` or split by workspace). The only gap is that it does not compare itself to sibling tools like `scan_lockfile_deep`.

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.