getVpnInfo
Retrieve VPN details for the device in the Current Operating Environment to monitor or manage network configurations effectively.
Instructions
获取当前设备的 VPN 信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:478-500 (handler)Handler implementation for 'getVpnInfo' tool. Scans os.networkInterfaces() for interfaces starting with 'tun' or 'ppp', collects their IP details, and returns as JSON.case "getVpnInfo": { const networkInterfaces = os.networkInterfaces(); const vpnInterfaces: Record<string, any> = {}; for (const [interfaceName, interfaces = []] of Object.entries(networkInterfaces)) { // 检测常见的 VPN 接口名称(如 tun0, ppp0, etc) if (interfaceName.startsWith('tun') || interfaceName.startsWith('ppp')) { vpnInterfaces[interfaceName] = interfaces.map((info) => ({ address: info.address, netmask: info.netmask, family: info.family, internal: info.internal })); } } return { content: [{ type: "text", text: JSON.stringify(vpnInterfaces, null, 2) }] }; }
- src/index.ts:137-144 (schema)Tool definition including name, description, and empty input schema for 'getVpnInfo'.name: "getVpnInfo", description: "获取当前设备的 VPN 信息", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:137-144 (registration)Registration of 'getVpnInfo' tool in the tools list array used for ListToolsRequest.name: "getVpnInfo", description: "获取当前设备的 VPN 信息", inputSchema: { type: "object", properties: {}, required: [] } },