Skip to main content
Glama
yuchen814

npm-registry-mcp-server

by yuchen814

Get npm package metadata

get_npm_package_metadata
Read-onlyIdempotent

Retrieve npm package metadata by name, version, dist-tag, or semver range. Supports scoped packages and returns abbreviated or full metadata, including all versions.

Instructions

Fetch metadata for a package from the npm registry. Requires a package name and optionally accepts a version, dist-tag, or semver range (defaults to "latest"). By default an abbreviated metadata document is returned for performance; set fullMetadata to true for the complete document. Set allVersions to true to get the registry's main entry containing every version (this takes precedence over version). Works with scoped and private packages, honouring .npmrc registry and auth settings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
versionNoOptional version, dist-tag, or semver range. Defaults to "latest". Examples: "1.0.0", "next", "1" (latest 1.x.x), "1.2" (latest 1.2.x), "^1.2.3", "~1.2.3".
allVersionsNoReturn the registry's main entry containing all versions. Overrides `version`.
packageNameYesnpm package name. Scoped packages are supported, e.g. "@sindresorhus/df".
registryUrlNoOptional registry URL override. Defaults to the registry inferred from npm defaults and .npmrc. Intended for internal tooling only.
fullMetadataNoReturn the full metadata document instead of the abbreviated one. Slower but complete.
omitDeprecatedNoOmit versions marked deprecated on the registry. An explicit version or dist-tag is still returned even when deprecated.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
metadataYesRaw metadata document from the registry.
allVersionsYes
packageNameYes
registryUrlNo
fullMetadataYes
omitDeprecatedYes
resolvedVersionNo
requestedVersionNo
Behavior4/5

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

Annotations already cover read-only, open-world, and idempotent behavior. The description adds valuable non-obvious behaviors: default 'latest' version, abbreviated vs. full metadata, allVersions precedence, and .npmrc auth/registry handling. This goes beyond the structured annotations, though it doesn't cover error cases or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is 3 sentences, front-loaded with the core purpose, then details key options and edge cases. Every sentence adds information, with no fluff or repetition of schema descriptions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, returning values need not be explained. The description covers the tool's main behavioral facets: version selection, metadata format, allVersions precedence, and support for scoped/private packages with .npmrc. Minor gaps like error handling are not critical given the read-only nature and available schema.

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 coverage is 100% with detailed parameter descriptions, so the baseline is 3. The description enriches semantics by explaining the relationship between fullMetadata and allVersions, and the performance implications of abbreviated vs. full documents. It adds value beyond the schema's per-field descriptions.

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 verb and resource: 'Fetch metadata for a package from the npm registry.' It clearly distinguishes from the sibling tool (list_npm_package_versions) by focusing on metadata retrieval, not just version listing. The additional details about version selection and metadata formats reinforce scope.

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?

Provides clear context on how to use the tool: default to 'latest', options for fullMetadata and allVersions, with precedence noted. It does not explicitly mention when to use this tool over list_npm_package_versions, but the usage context is otherwise strong. Missing explicit exclusions or alternatives drops it slightly from a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuchen814/npm-registry-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server