Skip to main content
Glama
eva-wanxin-git

Windows Automation MCP Server

get_network_info

Retrieve network configuration details from Windows systems to monitor connectivity and troubleshoot network issues.

Instructions

获取网络信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that runs a PowerShell command to get IPv4 network addresses from non-loopback interfaces, parses the JSON output, and returns the interfaces list.
    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 };
      }
    }
  • Input schema definition for the get_network_info tool (no required properties).
    inputSchema: {
      type: 'object',
      properties: {},
    },
  • Tool definition registration in getToolDefinitions(), including name, description, and schema.
    {
      name: 'get_network_info',
      description: '获取网络信息',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Registration in the executeTool switch statement that routes to the getNetworkInfo handler.
      return await this.getDiskInfo();
    case 'get_network_info':
      return await this.getNetworkInfo();
  • canHandle method registers get_network_info in the supported tools array.
    canHandle(toolName) {
      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