getNetworkInterfaces
Retrieve network interface details to identify IP addresses, MAC addresses, and connection status for system diagnostics and monitoring.
Instructions
Get network interface information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/network.ts:17-25 (handler)The handler function executes os.networkInterfaces() and returns the interfaces as prettified JSON in the required MCP content format.handler: async () => { const interfaces = os.networkInterfaces(); return { content: [{ type: 'text', text: JSON.stringify(interfaces, null, 2) }] }; }
- src/tools/network.ts:13-16 (schema)Input schema defining no required parameters for the getNetworkInterfaces tool.inputSchema: { type: 'object', properties: {} },
- src/tools/network.ts:10-26 (registration)Tool definition and registration within the networkTools export object.getNetworkInterfaces: { name: 'getNetworkInterfaces', description: 'Get network interface information', inputSchema: { type: 'object', properties: {} }, handler: async () => { const interfaces = os.networkInterfaces(); return { content: [{ type: 'text', text: JSON.stringify(interfaces, null, 2) }] }; } },
- src/index.ts:28-35 (registration)Registration of networkTools (including getNetworkInterfaces) into the central allTools object used by MCP server handlers for listing and calling tools.const allTools: ToolKit = { ...systemTools, ...networkTools, ...geoTools, ...generatorTools, ...dateTimeTools, ...securityTools };