Skip to main content
Glama
batteryshark

System Information MCP Server

by batteryshark

get_hardware_details

Retrieve detailed hardware specifications including CPU, RAM, GPU, and storage information for system diagnostics and capability assessment.

Instructions

Get comprehensive hardware information - CPU, RAM, GPU, storage overview.

Detailed hardware specs including performance metrics and device detection. Use for hardware diagnostics and system capability assessment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool, which registers and implements the get_hardware_details tool. It calls the get_hardware_info helper and returns formatted ToolResult.
    @mcp.tool
    def get_hardware_details() -> ToolResult:
        """Get comprehensive hardware information - CPU, RAM, GPU, storage overview.
        
        Detailed hardware specs including performance metrics and device detection.
        Use for hardware diagnostics and system capability assessment.
        """
        info_sections = []
        info_sections.append("# Hardware Details")
        info_sections.append(f"*Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*\n")
        
        try:
            info_sections.extend(get_hardware_info())
        except Exception as e:
            info_sections.append(f"⚠️ **Hardware detection error**: {str(e)}")
        
        return text_response("\n".join(info_sections))
  • Core helper function that collects detailed hardware information including CPU stats, RAM usage, GPU details (platform-specific), battery info, and system uptime using psutil and platform tools.
    def get_hardware_info() -> List[str]:
        """Get hardware information (CPU, RAM, GPU)"""
        info = []
        info.append("\n## 🔧 Hardware")
        
        # CPU Information
        cpu_count = psutil.cpu_count(logical=False)
        cpu_logical = psutil.cpu_count(logical=True)
        cpu_freq = psutil.cpu_freq()
        cpu_percent = psutil.cpu_percent(interval=1)
        
        info.append(f"- **CPU Cores**: {cpu_count} physical, {cpu_logical} logical")
        if cpu_freq:
            info.append(f"- **CPU Frequency**: {cpu_freq.current:.0f} MHz (max: {cpu_freq.max:.0f} MHz)")
        info.append(f"- **CPU Usage**: {cpu_percent}%")
        
        # Memory Information
        memory = psutil.virtual_memory()
        swap = psutil.swap_memory()
        
        info.append(f"- **Total RAM**: {memory.total / (1024**3):.1f} GB")
        info.append(f"- **Available RAM**: {memory.available / (1024**3):.1f} GB ({memory.percent}% used)")
        if swap.total > 0:
            info.append(f"- **Swap**: {swap.total / (1024**3):.1f} GB ({swap.percent}% used)")
        
        # GPU Information
        gpu_info = _get_gpu_info()
        if gpu_info:
            info.extend(gpu_info)
        
        # Battery Information (if available)
        battery_info = _get_battery_info()
        if battery_info:
            info.extend(battery_info)
        
        # Boot time and uptime
        boot_time = datetime.fromtimestamp(psutil.boot_time())
        uptime = datetime.now() - boot_time
        info.append(f"\n- **Boot Time**: {boot_time.strftime('%Y-%m-%d %H:%M:%S')}")
        info.append(f"- **Uptime**: {uptime.days} days, {uptime.seconds//3600} hours")
        
        return info

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