Skip to main content
Glama

Windows Automation MCP Server

get_network_info

Retrieve network configuration details including IP addresses, connection status, and adapter information from Windows systems for troubleshooting and monitoring purposes.

Instructions

获取网络信息

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The main handler function that executes a PowerShell command to retrieve IPv4 network interface information, excluding loopback interfaces, and parses the JSON output.
    async getNetworkInfo() { try { const command = ` Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notlike '*Loopback*' } | ForEach-Object { @{ Interface = $_.InterfaceAlias IPAddress = $_.IPAddress PrefixLength = $_.PrefixLength } } | ConvertTo-Json `; const { stdout } = await execAsync(`powershell -Command "${command.replace(/"/g, '\\"')}"`, { shell: 'powershell.exe' }); let interfaces = []; try { interfaces = JSON.parse(stdout); if (!Array.isArray(interfaces)) { interfaces = [interfaces]; } } catch { interfaces = []; } return { success: true, interfaces }; } catch (error) { return { success: false, error: error.message }; } }
  • Tool definition including name, description, and empty input schema (no parameters required).
    { name: 'get_network_info', description: '获取网络信息', inputSchema: { type: 'object', properties: {}, }, },
  • Dispatches to the getNetworkInfo handler in the executeTool switch statement.
    case 'get_network_info': return await this.getNetworkInfo();
  • Includes 'get_network_info' in the list of tools that this handler can process in the canHandle method.
    const tools = ['run_powershell', 'run_cmd', 'get_system_info', 'get_disk_info', 'get_network_info']; return tools.includes(toolName);

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/eva-wanxin-git/windows-automation-mcp'

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