Skip to main content
Glama

npm_package

Look up npm package metadata and README markdown, with optional version pinning and GitHub readme retrieval.

Instructions

Look up a package on the npm registry (metadata + readme).

Returns name, resolved version, description, license, homepage, repository URL, keywords, engines, dependencies and the readme as markdown. When version is given the lookup is pinned to that release; otherwise the latest version is used. Metadata is cached for 1 day keyed by name+version; failures are never cached.

npm no longer puts the README in the packument — for modern packages the readme field is an empty string — so the document is fetched from the package's GitHub repository. When it is found, readme_source names the exact file (e.g. github:colinhacks/zod@HEAD/packages/zod/README.md); when it is not, readme_markdown stays null and note says why. Only github.com repositories are followed; gitlab/bitbucket packages and repos with no repository URL get the note, not a guess.

max_tokens truncates the README to roughly that many tokens (estimated as len(text)//4), cut at a line boundary, and sets "truncated": true when applied. The cache keeps the full README, so the same entry can answer a later call with a larger max_tokens.

On failure returns {"ok": False, "error", "suggestion"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
versionNo
max_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses the 1-day cache keyed by name+version, that failures are never cached, that the readme is fetched from GitHub because the packument no longer carries it, that only github.com repos are followed, and the exact failure return shape. These are behavioral traits an agent could not infer from the schema.

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-loads the purpose and the first sentence names the return payload; subsequent paragraphs each cover a distinct behavior (caching, readme sourcing, truncation, errors). Slightly long, but every block addresses something an agent needs, so little is wasted.

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?

There is no output schema, so the description takes on the return-value burden and covers both success fields (name, version, license, readme, readme_source, note) and the error shape with an ok/error/suggestion structure. Nothing material is missing for correct invocation.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it does for two of three parameters: version semantics (pin vs latest) and max_tokens behavior (rough len//4 token estimate, line-boundary cut, truncated flag, full readme retained in cache for later larger calls). Only `name` is left to obvious inference.

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?

States a specific verb and resource ("look up a package on the npm registry") plus the payload scope (metadata + readme), and returns a concrete field list. It is readily distinguishable from siblings like js_docs or js_search, which operate on local or documented code rather than the npm registry.

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

Usage Guidelines3/5

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

The description gives clear conditional behavior for the version parameter (pinned vs latest), but never says when to prefer this tool over the sibling js_docs/js_search/js_status. Usage is implied by the registry framing rather than stated, so it falls at minimum-viable.

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

Deploy Server

Other Tools