Skip to main content
Glama

deprecate

Mark npm package versions as deprecated to warn users about outdated or insecure releases. Specify version ranges and add custom messages to guide users toward better alternatives.

Instructions

Deprecate a version of a package

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageYesPackage@version range (e.g. pkg@<1.0.0)
messageYesDeprecation message (empty string to undeprecate)
otpNoOne-time password for 2FA

Implementation Reference

  • The handler function that executes the `npm deprecate` command using the provided arguments and returns the result.
    async ({ package: pkg, message, otp }) => {
      const args = ["deprecate", pkg, message];
      if (otp) args.push("--otp", otp);
      try {
        const { stdout, stderr } = await run(args);
        return {
          content: [{ type: "text", text: stdout + stderr || (message ? "Deprecated successfully" : "Undeprecated successfully") }],
        };
      } catch (e: any) {
        return {
          content: [{ type: "text", text: `Error: ${e.stderr || e.message}` }],
          isError: true,
  • Zod schema defining the input arguments for the "deprecate" tool.
    {
      package: z.string().describe("Package@version range (e.g. pkg@<1.0.0)"),
      message: z.string().describe("Deprecation message (empty string to undeprecate)"),
      otp: z.string().optional().describe("One-time password for 2FA"),
    },
  • src/index.ts:181-183 (registration)
    Registration of the "deprecate" tool on the MCP server.
    server.tool(
      "deprecate",
      "Deprecate a version of a package",

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