getIpv6Info
Retrieve detailed IPv6 information for the current device operating environment to support network configuration and troubleshooting needs.
Instructions
获取当前设备的 IPv6 信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:430-454 (handler)Handler implementation for the getIpv6Info tool. It retrieves network interfaces using os.networkInterfaces(), filters for IPv6 addresses, and returns a structured JSON object grouped by network interface.case "getIpv6Info": { const networkInterfaces = os.networkInterfaces(); const ipInfo: Record<string, { address: string; netmask: string; family: string; internal: boolean }[]> = {}; for (const [interfaceName, interfaces = []] of Object.entries(networkInterfaces)) { const ipv6Interfaces = interfaces .filter((info) => info.family === 'IPv6') .map((info) => ({ address: info.address, netmask: info.netmask, family: info.family, internal: info.internal })); if (ipv6Interfaces.length > 0) { ipInfo[interfaceName] = ipv6Interfaces; } } return { content: [{ type: "text", text: JSON.stringify(ipInfo, null, 2) }] }; }
- src/index.ts:109-117 (registration)Registration of the getIpv6Info tool in the listTools response, including name, description, and input schema (empty object).{ name: "getIpv6Info", description: "获取当前设备的 IPv6 信息", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:112-116 (schema)Input schema for the getIpv6Info tool, which is an empty object with no parameters.inputSchema: { type: "object", properties: {}, required: [] }