Skip to main content
Glama
JackXuyi

Current operating environment

getAvailableNetworks

Retrieve available network connections and their details for the current device to identify connectivity options and troubleshoot network issues.

Instructions

获取当前设备可用的网络信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'getAvailableNetworks' tool. Retrieves active network interfaces and available WiFi networks using os.networkInterfaces() and si.wifiNetworks(), formats them, and returns as JSON response.
    case "getAvailableNetworks": { const networkInterfaces = os.networkInterfaces(); const availableNetworks: Record<string, any> = {}; // 获取网络接口信息 for (const [interfaceName, interfaces = []] of Object.entries(networkInterfaces)) { availableNetworks[interfaceName] = interfaces.map((info) => ({ address: info.address, netmask: info.netmask, family: info.family, internal: info.internal })); } // 获取 Wi-Fi 网络信息 const wifiNetworks = await si.wifiNetworks(); return { content: [{ type: "text", text: JSON.stringify({ networkInterfaces: availableNetworks, wifiNetworks }, null, 2) }] }; }
  • src/index.ts:181-189 (registration)
    Registration of the 'getAvailableNetworks' tool in the list of available tools, including its name, description, and input schema (no parameters required).
    { name: "getAvailableNetworks", description: "获取当前设备可用的网络信息", 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