Skip to main content
Glama

traceroute

Trace the network path to a target host to identify connectivity issues and routing problems.

Instructions

Perform traceroute to a host

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesTarget host

Implementation Reference

  • The handler function for the 'traceroute' tool. It determines the platform-specific command (tracert on Windows, traceroute on Unix-like), executes it via child_process.exec, returns stdout as text content, or throws an error on failure.
    handler: async ({ host }: { host: string }) => {
      const platform = os.platform();
      const cmd = platform === 'win32' ? `tracert ${host}` : `traceroute ${host}`;
    
      try {
        const { stdout } = await execAsync(cmd);
        return {
          content: [{
            type: 'text',
            text: stdout
          }]
        };
      } catch (error) {
        throw new Error(`Traceroute failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Input schema definition for the traceroute tool, specifying an object with a required 'host' string property.
    inputSchema: {
      type: 'object',
      properties: {
        host: {
          type: 'string',
          description: 'Target host'
        }
      },
      required: ['host']
    },
  • src/index.ts:28-35 (registration)
    Registration of networkTools (containing traceroute) into the central allTools object, which is used for listing available tools and dispatching tool calls.
    const allTools: ToolKit = {
      ...systemTools,
      ...networkTools,
      ...geoTools,
      ...generatorTools,
      ...dateTimeTools,
      ...securityTools
    };

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