Skip to main content
Glama

get_system_info

Retrieve comprehensive system details including kernel version, architecture, hostname, uptime, and memory statistics for system analysis and troubleshooting.

Instructions

Get comprehensive system information including kernel version, architecture, hostname, uptime, and memory statistics. Works on any system.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the get_system_info tool, gathering kernel version, architecture, hostname, uptime, memory usage, and Arch Linux detection.
    async def get_system_info() -> Dict[str, Any]: """ Get core system information. Returns: Dict with kernel, architecture, hostname, uptime, memory info """ logger.info("Gathering system information") info = {} try: # Kernel version exit_code, stdout, _ = await run_command(["uname", "-r"], timeout=5, check=False) if exit_code == 0: info["kernel"] = stdout.strip() # Architecture exit_code, stdout, _ = await run_command(["uname", "-m"], timeout=5, check=False) if exit_code == 0: info["architecture"] = stdout.strip() # Hostname exit_code, stdout, _ = await run_command(["hostname"], timeout=5, check=False) if exit_code == 0: info["hostname"] = stdout.strip() # Uptime exit_code, stdout, _ = await run_command(["uptime", "-p"], timeout=5, check=False) if exit_code == 0: info["uptime"] = stdout.strip() # Memory info from /proc/meminfo try: meminfo_path = Path("/proc/meminfo") if meminfo_path.exists(): with open(meminfo_path, "r") as f: meminfo = f.read() # Parse memory values mem_total_match = re.search(r"MemTotal:\s+(\d+)", meminfo) mem_available_match = re.search(r"MemAvailable:\s+(\d+)", meminfo) if mem_total_match: info["memory_total_kb"] = int(mem_total_match.group(1)) info["memory_total_mb"] = int(mem_total_match.group(1)) // 1024 if mem_available_match: info["memory_available_kb"] = int(mem_available_match.group(1)) info["memory_available_mb"] = int(mem_available_match.group(1)) // 1024 except Exception as e: logger.warning(f"Failed to read memory info: {e}") info["is_arch_linux"] = IS_ARCH logger.info("Successfully gathered system information") return info except Exception as e: logger.error(f"Failed to gather system info: {e}") return create_error_response( "SystemInfoError", f"Failed to gather system information: {str(e)}" )
  • Registers the get_system_info tool in the MCP server's list_tools() method, including its description and empty input schema (no parameters required).
    Tool( name="get_system_info", description="[MONITORING] Get comprehensive system information including kernel version, architecture, hostname, uptime, and memory statistics. Works on any system.", inputSchema={ "type": "object", "properties": {} } ),
  • The dispatch logic in the MCP server's call_tool() method that invokes the get_system_info handler and formats the JSON response.
    elif name == "get_system_info": result = await get_system_info() return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Metadata definition for the get_system_info tool, categorizing it as monitoring/diagnose with related tools.
    "get_system_info": ToolMetadata( name="get_system_info", category="monitoring", platform="any", permission="read", workflow="diagnose", related_tools=["check_disk_space", "check_failed_services"], prerequisite_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/nihalxkumar/arch-mcp'

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