Skip to main content
Glama

profile

View or update npm user profile settings like email, full name, or homepage using get or set actions.

Instructions

View or modify npm user profile settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform
fieldNoProfile field to get or set (e.g. email, fullname, homepage)
valueNoValue to set (required for set action)
otpNoOne-time password for 2FA

Implementation Reference

  • The implementation of the 'profile' tool, which allows viewing or modifying npm user profile settings by executing 'npm profile' commands.
    server.tool(
      "profile",
      "View or modify npm user profile settings",
      {
        action: z.enum(["get", "set"]).describe("Action to perform"),
        field: z.string().optional().describe("Profile field to get or set (e.g. email, fullname, homepage)"),
        value: z.string().optional().describe("Value to set (required for set action)"),
        otp: z.string().optional().describe("One-time password for 2FA"),
      },
      async ({ action, field, value, otp }) => {
        const args = ["profile", action];
        if (field) args.push(field);
        if (action === "set" && value) args.push(value);
        if (action === "get") args.push("--json");
        if (otp) args.push("--otp", otp);
        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