Skip to main content
Glama

traceroute

Trace the path of data packets to a target host, identifying network hops and latency issues for troubleshooting network connectivity problems.

Instructions

Perform traceroute to a host

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesTarget host

Implementation Reference

  • The traceroute tool handler function. It determines the platform, constructs the appropriate command (tracert on Windows, traceroute on others), executes it via child_process.exec, and returns the stdout as text content. Throws an error if execution fails.
    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 for the traceroute tool, defining a required 'host' string parameter.
    inputSchema: { type: 'object', properties: { host: { type: 'string', description: 'Target host' } }, required: ['host'] },
  • src/index.ts:29-36 (registration)
    Registers the networkTools object (containing the traceroute tool) into the allTools object, which is used by the MCP server for listing and dispatching tool calls.
    ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };
  • src/index.ts:146-148 (registration)
    Specific condition in tool call handler to assign the networkRateLimiter to traceroute tool executions.
    request.params.name === 'ping_host' || request.params.name === 'traceroute') { rateLimiter = networkRateLimiter;

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