Skip to main content
Glama

ai_guard_check_package

Read-onlyIdempotent

Checks npm packages before install or npx to flag nonexistent names, look-alikes, fresh releases, install scripts, and other risks, returning a block verdict when a package should not be used.

Instructions

Check npm packages before installing or running them (npm install, npx). Reports names that do not exist (often invented by assistants), look-alikes of popular packages, new or rarely downloaded packages, install scripts, deprecations, npm security placeholders and releases published in the last day. verdict "block" means do not install; use the package named in similarTo or check the name. A fresh-release finding means ask the user or install the previous version. Contacts registry.npmjs.org and api.npmjs.org; packages from a private registry are skipped. Installs nothing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "packages": "<packages>"
    },
    "name": "ai_guard_check_package"
  }
}

Input Schema

NameRequiredDescriptionDefault
packagesYesPackage names, optionally with a version or dist-tag: "lodash", "react@18.3.1", "@types/node"
freshHoursNoVersions published fewer hours ago are fresh releases (default 24; 0 turns the check off)
minAgeDaysNoPackages first published fewer days ago count as new (default 30)
minWeeklyDownloadsNoFewer weekly downloads count as rarely used (default 100)

Output Schema

NameRequiredDescriptionDefault
errorsYes
statusYes
successYes
packagesYes
safeToInstallYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations, it discloses the external endpoints contacted (registry.npmjs.org and api.npmjs.org), that packages from a private registry are skipped, and that nothing is installed — behavior an agent could not infer from readOnlyHint/openWorldHint alone. It also interprets the 'block' verdict and the similarTo field, telling the agent how to act on results.

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?

Purpose and trigger are front-loaded, and every sentence carries substance (finding types, verdict handling, network endpoints). It is dense and slightly run-on with verdict/fresh-release guidance packed into the middle, but no sentence is pure filler.

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 an output schema exists, the description need not document return values, yet it still explains the verdict and similarTo semantics an agent must act on. Combined with the private-registry skip and no-install guarantee, an agent has everything needed to call it safely and interpret results.

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?

Schema description coverage is 100%, so defaults and bounds for freshHours, minAgeDays and minWeeklyDownloads are already documented in the schema. The description only echoes the thresholds conceptually ('releases published in the last day', 'new or rarely downloaded'), so it adds little beyond the structured fields, matching the baseline 3.

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 first sentence names a specific verb and resource ('Check npm packages') and pins the exact moment of use ('before installing or running them (npm install, npx)'). The finding categories listed (nonexistent names, look-alikes, fresh releases, install scripts, deprecations) sharply distinguish it from the scan_* / fix siblings.

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?

It states clearly when to call it (pre-install, npm install/npx) and prescribes actions per finding type: verdict 'block' means do not install, fresh-release means ask the user or install the previous version. It doesn't name a sibling tool as the alternative when a different check is more appropriate, which keeps it at 4 rather than 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.