Skip to main content
Glama

pingHost

Check network connectivity by sending ping requests to a target host and measuring response times.

Instructions

Ping a host using system ping command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesTarget host to ping
countNoNumber of ping requests

Implementation Reference

  • The handler function for the pingHost tool. It constructs a platform-specific ping command (Windows: ping -n, Unix: ping -c), executes it using execAsync, and returns the stdout output or throws an error.
    handler: async ({ host, count = 4 }: { host: string; count?: number }) => {
      const platform = os.platform();
      const pingCmd = platform === 'win32' 
        ? `ping -n ${count} ${host}`
        : `ping -c ${count} ${host}`;
    
      try {
        const { stdout } = await execAsync(pingCmd);
        return {
          content: [{
            type: 'text',
            text: stdout
          }]
        };
      } catch (error) {
        throw new Error(`Ping failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Input schema definition for the pingHost tool, requiring a 'host' string and optionally a 'count' number.
    inputSchema: {
      type: 'object',
      properties: {
        host: {
          type: 'string',
          description: 'Target host to ping'
        },
        count: {
          type: 'number',
          description: 'Number of ping requests',
          default: 4
        }
      },
      required: ['host']
    },
  • src/index.ts:28-35 (registration)
    The allTools object spreads networkTools (which includes pingHost) to register it for tool lookup and execution.
    const allTools: ToolKit = {
      ...systemTools,
      ...networkTools,
      ...geoTools,
      ...generatorTools,
      ...dateTimeTools,
      ...securityTools
    };
  • src/index.ts:6-6 (registration)
    Imports the networkTools object containing the pingHost tool definition.
    import { networkTools } from './tools/network.js';
  • Rate limiter selection references 'ping_host' (note: tool name is 'pingHost'), applying networkRateLimiter.
    } else if (request.params.name.startsWith('get_network') ||
              request.params.name === 'ping_host' ||
              request.params.name === 'traceroute') {
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions using the 'system ping command', which implies it executes a system-level operation, but doesn't disclose critical traits like whether it requires specific permissions, potential side effects (e.g., network traffic), rate limits, or output format. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—it directly states the tool's purpose without redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every word earns its place, exemplifying conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a system command execution with parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., ping statistics, success/failure), error conditions, or behavioral nuances. For a tool that could have varied outputs and side effects, this is inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for both parameters ('host' and 'count'). The description adds no additional meaning beyond what the schema provides, such as explaining ping-specific semantics (e.g., host can be IP or domain, count affects timing). Baseline is 3 when the schema does the heavy lifting, as here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Ping') and target ('a host'), specifying it uses the 'system ping command'. This provides a specific verb+resource combination that distinguishes it from siblings like 'checkConnectivity' or 'traceroute'. However, it doesn't explicitly differentiate from all siblings (e.g., 'checkConnectivity' might be similar), so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'checkConnectivity' or 'traceroute'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent to infer usage based on the name alone. This is minimal guidance, scoring above 1 only because the purpose is clear enough to imply basic usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cyanheads/toolkit-mcp-server'

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