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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| version | No | ||
| max_tokens | No |