Skip to main content
Glama

IT Tools MCP Server

index.ts•1.12 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import ping from "ping"; export function registerPing(server: McpServer) { server.registerTool("ping", { description: "Test network connectivity to a host. Example: ping google.com to check if it's reachable", inputSchema: { target: z.string().describe("Host to ping"), count: z.number().default(4).describe("Number of ping attempts") }, // VS Code compliance annotations annotations: { title: "Ping", description: "Test network connectivity to a host", readOnlyHint: false } }, async ({ target, count }) => { try { const res = await ping.promise.probe(target, { min_reply: count }); return { content: [ { type: "text", text: `Ping to ${target}:\nAlive: ${res.alive}\nTime: ${res.time} ms\nOutput: ${res.output}` } ] }; } catch (error) { return { isError: true, content: [{ type: "text", text: `Ping failed: ${error instanceof Error ? error.message : error}` }] }; } } ); }

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/wrenchpilot/it-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server