Skip to main content
Glama
batteryshark

System Information MCP Server

by batteryshark

get_network_status

Retrieve network configuration, connectivity status, and diagnostics including interfaces, IP addresses, DNS settings, and VPN detection for troubleshooting and security analysis.

Instructions

Get network configuration and connectivity - interfaces, IPs, DNS, VPN status.

Complete network diagnostics including external connectivity and VPN detection. Essential for troubleshooting network issues and security analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'get_network_status' tool. Decorated with @mcp.tool for automatic registration in the FastMCP server. It invokes get_network_info() from collectors, formats the output, and returns a ToolResult with text content.
    @mcp.tool
    def get_network_status() -> ToolResult:
        """Get network configuration and connectivity - interfaces, IPs, DNS, VPN status.
        
        Complete network diagnostics including external connectivity and VPN detection.
        Essential for troubleshooting network issues and security analysis.
        """
        info_sections = []
        info_sections.append("# Network Status")
        info_sections.append(f"*Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*\n")
        
        try:
            info_sections.extend(get_network_info())
        except Exception as e:
            info_sections.append(f"⚠️ **Network detection error**: {str(e)}")
        
        return text_response("\n".join(info_sections))
  • The core helper function get_network_info() that implements the network status logic: enumerates network interfaces with psutil.net_if_addrs(), retrieves gateway/DNS info platform-specifically, fetches external IP via AWS checkip, detects VPN via interface names, and compiles markdown-formatted info list.
    def get_network_info() -> List[str]:
        """Get network interface and connectivity information"""
        info = []
        info.append("\n## 🌐 Network")
        
        # Network interfaces
        net_interfaces = psutil.net_if_addrs()
        net_stats = psutil.net_if_stats()
        
        for interface, addresses in net_interfaces.items():
            if interface.startswith('lo') or interface.startswith('utun'):
                continue  # Skip loopback and tunnels for main display
            
            stats = net_stats.get(interface)
            if stats and stats.isup:
                info.append(f"\n### {interface}")
                info.append(f"- **Status**: {'Up' if stats.isup else 'Down'}")
                
                for addr in addresses:
                    if addr.family.name == 'AF_INET':  # IPv4
                        info.append(f"- **IPv4**: {addr.address}")
                        if addr.netmask:
                            info.append(f"  - **Netmask**: {addr.netmask}")
                    elif addr.family.name == 'AF_INET6':  # IPv6
                        if not addr.address.startswith('fe80'):  # Skip link-local
                            info.append(f"- **IPv6**: {addr.address}")
        
        # Gateway and DNS
        gateway = _get_default_gateway()
        if gateway:
            info.append(f"\n- **Default Gateway**: {gateway}")
        
        dns_servers = _get_dns_servers()
        if dns_servers:
            info.append(f"- **DNS Servers**: {', '.join(dns_servers[:3])}")
        
        # External IP
        external_ip = _get_external_ip()
        info.append(f"- **External IP**: {external_ip}")
        
        # VPN Detection
        vpn_status = _detect_vpn(net_interfaces, net_stats)
        info.append(f"- **VPN Status**: {vpn_status}")
        
        return info
  • The @mcp.tool decorator on get_network_status() handles tool registration in the FastMCP instance created earlier in the file.
    @mcp.tool
    def get_network_status() -> ToolResult:
        """Get network configuration and connectivity - interfaces, IPs, DNS, VPN status.
        
        Complete network diagnostics including external connectivity and VPN detection.
        Essential for troubleshooting network issues and security analysis.
        """
        info_sections = []
        info_sections.append("# Network Status")
        info_sections.append(f"*Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*\n")
        
        try:
            info_sections.extend(get_network_info())
        except Exception as e:
            info_sections.append(f"⚠️ **Network detection error**: {str(e)}")
        
        return text_response("\n".join(info_sections))
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions what the tool includes ('network diagnostics', 'external connectivity and VPN detection'), which adds useful context beyond basic purpose. However, it lacks details on potential side effects, performance implications, or output format, leaving some behavioral aspects unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that are front-loaded with key information ('Get network configuration and connectivity') and avoid waste. While efficient, it could be slightly more structured, but it effectively conveys the essential details without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (network diagnostics with no parameters) and lack of annotations and output schema, the description is moderately complete. It covers the purpose and usage context well but doesn't fully address behavioral aspects like what specific data is returned or how the diagnostics are performed, leaving some gaps for an agent to understand the tool fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the inputs. The description doesn't need to add parameter information, and it appropriately focuses on the tool's functionality without redundant details, earning a baseline score for this scenario.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get', 'diagnostics') and resources ('network configuration and connectivity', 'interfaces, IPs, DNS, VPN status'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_connected_devices' or 'get_open_ports', which might also relate to network aspects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool ('Essential for troubleshooting network issues and security analysis'), which helps guide usage. It doesn't specify when not to use it or name alternatives among siblings, but the context is sufficient for typical decision-making.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/batteryshark/mcp-sysinfo'

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