Skip to main content
Glama

Analyze an npm package install script

analyze_install_script
Read-only

Statically scans a package's preinstall/install/postinstall/prepare lifecycle scripts AND the file(s) they reference — fetched directly from the published tarball, not just the command string in package.json — against npmscan's documented red-flags rubric (/docs/red-flags): child_process use, network calls, access to sensitive paths/env (.ssh, .aws, .npmrc, *TOKEN/*KEY), obfuscation, remote binaries hosted off trusted CDNs, writes to HOME, Discord/Telegram/Pastebin exfil endpoints, eval on decoded strings, chmod+exec of downloaded binaries, and CI-metadata telemetry — plus a possibleTyposquatOf name check. Returns a weighted totalScore and riskTier ('none'/'low'/'moderate'/'high'/'critical'). This is a heuristic static scan, not proof of malice or a guarantee of safety: it doesn't execute any code, can't see behavior gated on runtime conditions, and does NOT check maintainer/ownership history (a separate red-flags signal this tool doesn't cover). Use get_package/get_package_version first for the raw script listing; use this when you need to know what an install script actually does, not just that one exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesExact npm package name, e.g. "lodash" or "@scope/name"
versionNoExact version to analyze; omit to use the latest published version

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
versionYes
findingsYes
riskTierYes
scanNoteYes
npmscanUrlYes
totalScoreYes
filesScannedYes
lifecycleScriptsYes
hasLifecycleScriptsYes
possibleTyposquatOfYes

Schema Changelog

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

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description reveals essential behavioral traits: it fetches directly from the published tarball, performs a heuristic static scan, does not execute code, cannot detect behavior gated on runtime conditions, and returns a weighted score and risk tier. This is substantial added context beyond the annotations.

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?

The description is long but every element earns its place: scope, what it checks, return value, limitations, and usage guidance. The dense red-flag enumeration could be summarized more tightly, but it is informative rather than fluff. Overall, it is well structured and front-loaded with the core action.

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?

The description covers what the tool does, how it operates, its limitations, its output, and how it relates to siblings. Given that an output schema exists, the description is more than complete for an agent to decide when and how to invoke it.

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 coverage is 100% for both parameters (name and version), and the schema already explains their meaning and defaults. The description adds no additional parameter-level details, so the baseline of 3 is appropriate.

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 action and resource: 'Statically scans a package's preinstall/install/postinstall/prepare lifecycle scripts AND the file(s) they reference'. It also clearly differentiates itself from sibling tools by stating it does NOT check the raw script listing and explicitly points to get_package/get_package_version for that purpose.

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?

The description gives direct when-to-use guidance: 'use get_package/get_package_version first for the raw script listing; use this when you need to know what an install script actually does, not just that one exists.' It also states what the tool cannot do, such as not executing code and not seeing runtime-gated behavior, which helps agents decide if this is the right tool.

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