Skip to main content
Glama

Search npm packages

search_packages
Read-only

Search the npm registry by name or keywords. Each result includes its current weekly/monthly download counts, dependentsCount (how many other npm packages depend on it), topPackagesRank (position among npmscan's own top-100k-by-downloads snapshot — not live, but a second independent popularity signal), and deterministic (not model-generated) popularityTier/maintenanceTier labels — a package matching the query with a 'very-low' popularityTier, zero dependents, or a 'stale' maintenanceTier is very likely an abandoned, copy-paste, or squatted package, not a real contender, regardless of how relevant its name/description look. A result may also carry possibleTyposquatOf — set when its name is one typo away (e.g. 'raect' vs 'react') from a top-5,000 package while itself having very low popularity; treat that as a red flag to call out explicitly, not silently filter. Use these (not name recognition or the package's own README) to judge which candidates are actually established, and call get_package on your shortlist for install-script risk, TypeScript support, and GitHub stars before recommending one. Includes a link to each package's full npmscan.com risk/analysis page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results to return (default 20, max 50)
queryYesSearch text, e.g. a package name or keywords

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
totalYes
resultsYes
queryNoteYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / queryNote
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "query",
      -  "total",
      -  "results"
      -]New value: +[
      +  "query",
      +  "queryNote",
      +  "total",
      +  "results"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / query / maxLength
      Added value: +64
    • changedInput schema / properties / query / minLength
      Previous value: -1New value: +2
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "query": {
      +      "type": "string"
      +    },
      +    "results": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "dependentsCount": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "description": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "keywords": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "lastPublished": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "links": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "homepage": {
      +                "type": "string"
      +              },
      +              "npm": {
      +                "type": "string"
      +              },
      +              "repository": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "maintenanceTier": {
      +            "enum": [
      +              "active",
      +              "aging",
      +              "stale",
      +              "unknown"
      +            ],
      +            "type": "string"
      +          },
      +          "monthlyDownloads": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "npmscanUrl": {
      +            "type": "string"
      +          },
      +          "popularityTier": {
      +            "enum": [
      +              "very-high",
      +              "high",
      +              "moderate",
      +              "low",
      +              "very-low",
      +              "unknown"
      +            ],
      +            "type": "string"
      +          },
      +          "possibleTyposquatOf": {
      +            "anyOf": [
      +              {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "name": {
      +                    "type": "string"
      +                  },
      +                  "rank": {
      +                    "type": "number"
      +                  }
      +                },
      +                "required": [
      +                  "name",
      +                  "rank"
      +                ],
      +                "type": "object"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "publisher": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "topPackagesRank": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "version": {
      +            "type": "string"
      +          },
      +          "weeklyDownloads": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "name",
      +          "version",
      +          "description",
      +          "keywords",
      +          "publisher",
      +          "lastPublished",
      +          "links",
      +          "npmscanUrl",
      +          "weeklyDownloads",
      +          "monthlyDownloads",
      +          "dependentsCount",
      +          "topPackagesRank",
      +          "popularityTier",
      +          "maintenanceTier",
      +          "possibleTyposquatOf"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "query",
      +    "total",
      +    "results"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only state readOnly/openWorld/non-destructive; the description adds substantial behavioral context beyond them — the exact result fields, that topPackagesRank is a non-live snapshot, that popularityTier/maintenanceTier are deterministic rather than model-generated, and how to interpret 'very-low'/'stale'/zero-dependents packages. It also flags the possibleTyposquatOf red flag and warns against silently filtering, which is genuinely operational guidance.

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 is front-loaded in the first sentence and every subsequent clause carries interpretive value. It is dense and runs long as a single block, with the get_package follow-up advice buried mid-paragraph, so it loses a point on structure rather than on waste.

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?

An output schema exists, so return values need not be explained, yet the description still supplies the interpretation layer an agent actually needs (how to read tiers, dependents, typosquat flags). For a two-param search entrypoint, nothing required to call or use it 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?

Schema description coverage is 100%, so query and limit are already documented in the schema (including the default 20 / max 50 for limit). The description only paraphrases 'by name or keywords' and adds no extra syntax, format, or edge-case meaning, so the baseline 3 applies.

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?

Opens with a specific verb+resource: 'Search the npm registry by name or keywords.' It is clearly distinguishable from siblings like compare_packages or get_package, and it explicitly frames itself as the candidate-discovery step that feeds get_package.

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?

Gives clear usage context: use the returned tiers/dependents/typosquat signals rather than name recognition to judge candidates, then 'call get_package on your shortlist for install-script risk, TypeScript support, and GitHub stars before recommending one.' It also advises calling out typosquat hits instead of filtering them. It stops short of naming an explicit alternative search tool or a when-not-to-use condition.

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