Skip to main content
Glama

ping

Check connectivity to the npm registry to verify network access and server availability for package management operations.

Instructions

Check connectivity to the npm registry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the "ping" tool using the `run` helper to call `npm ping`.
    server.tool(
      "ping",
      "Check connectivity to the npm registry",
      {},
      async () => {
        try {
          const { stdout, stderr } = await run(["ping"]);
          return { content: [{ type: "text", text: stdout + stderr || "Registry is reachable" }] };
        } 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