Skip to main content
Glama

Current operating environment

getVpnInfo

Retrieve VPN details for the device in the Current Operating Environment to monitor or manage network configurations effectively.

Instructions

获取当前设备的 VPN 信息

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • 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) }] }; }
  • 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: [] } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JackXuyi/env-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server