Skip to main content
Glama

dist-tag

Manage npm package distribution tags to organize versions, control releases, and define aliases for specific package versions.

Instructions

Manage distribution tags

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform
packageYesPackage name (for add: pkg@version)
tagNoTag name (required for add/rm)

Implementation Reference

  • The implementation of the 'dist-tag' tool using the MCP server tool registration, handling distribution tag management for npm packages.
    server.tool(
      "dist-tag",
      "Manage distribution tags",
      {
        action: z.enum(["ls", "add", "rm"]).describe("Action to perform"),
        package: z.string().describe("Package name (for add: pkg@version)"),
        tag: z.string().optional().describe("Tag name (required for add/rm)"),
      },
      async ({ action, package: pkg, tag }) => {
        const args = ["dist-tag", action, pkg];
        if (tag && (action === "add" || action === "rm")) args.push(tag);
        try {
          const { stdout } = await run(args);
          return { content: [{ type: "text", text: stdout }] };
        } catch (e: any) {
          return {
            content: [{ type: "text", text: `Error: ${e.stderr || e.message}` }],
            isError: true,
          };
        }
      },
    );

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/mikusnuz/npm-mcp'

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