Skip to main content
Glama

Current operating environment

getAvailableNetworks

Retrieve a list of available networks on the current device, providing details about its operating environment for connectivity and network analysis.

Instructions

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

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • Handler implementation for the 'getAvailableNetworks' tool. Retrieves available network interfaces using os.networkInterfaces() and WiFi networks using si.wifiNetworks(), then returns formatted JSON.
    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)
    Tool registration in the listTools response, including name, description, and empty input schema.
    { name: "getAvailableNetworks", description: "获取当前设备可用的网络信息", inputSchema: { type: "object", properties: {}, required: [] } },
  • Input schema definition for the 'getAvailableNetworks' tool (empty object).
    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