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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:580-595 (handler)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, }; } }, );