getIpv6Info
Retrieve IPv6 address details for the current device to identify network configuration and connectivity status.
Instructions
获取当前设备的 IPv6 信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:430-453 (handler)Handler implementation for the 'getIpv6Info' tool. It retrieves all network interfaces using os.networkInterfaces(), filters for IPv6 addresses, structures the data by interface, and returns it as JSON text.
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 (schema)Schema definition for the 'getIpv6Info' tool, including name, description, and input schema (empty object as no parameters required). This is part of the tools list returned by ListToolsRequest.
{ name: "getIpv6Info", description: "获取当前设备的 IPv6 信息", inputSchema: { type: "object", properties: {}, required: [] } }, - src/index.ts:790-790 (registration)Registration of the CallToolRequest handler function, which contains the switch case dispatching to the getIpv6Info implementation.
server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);