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
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | Target host |
Implementation Reference
- src/tools/network.ts:159-174 (handler)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'}`); } }
- src/tools/network.ts:149-158 (schema)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 };