Skip to main content
Glama

version

Increment package version numbers in npm projects using semantic versioning rules to manage releases and dependencies.

Instructions

Bump the package version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the package directory
bumpYesVersion bump type
preidNoPrerelease identifier (e.g. alpha, beta)
noGitTagNoSkip git tag creation

Implementation Reference

  • The implementation of the 'version' tool, which wraps `npm version` to bump package versions.
    server.tool(
      "version",
      "Bump the package version",
      {
        path: z.string().describe("Absolute path to the package directory"),
        bump: z
          .enum(["patch", "minor", "major", "prepatch", "preminor", "premajor", "prerelease"])
          .describe("Version bump type"),
        preid: z.string().optional().describe("Prerelease identifier (e.g. alpha, beta)"),
        noGitTag: z.boolean().optional().describe("Skip git tag creation"),
      },
      async ({ path, bump, preid, noGitTag }) => {
        const args = ["version", bump];
        if (preid) args.push("--preid", preid);
        if (noGitTag) args.push("--no-git-tag-version");
        try {
          const { stdout } = await run(args, path);
          return { content: [{ type: "text", text: stdout.trim() }] };
        } 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