Skip to main content
Glama

check_mirrorlist_health

Verify mirror configuration health on Arch Linux by checking for common issues like inactive mirrors, outdated mirrorlists, and high latency connections.

Instructions

Verify mirror configuration health. Checks for common issues like no active mirrors, outdated mirrorlist, high latency. Only works on Arch Linux.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that implements the check_mirrorlist_health tool. Lists active mirrors, tests their speeds, identifies issues (no mirrors, high latency, etc.), computes a health score, and returns recommendations.
    async def check_mirrorlist_health() -> Dict[str, Any]: """ Verify mirror configuration health. Checks for common issues like no active mirrors, outdated mirrorlist. Returns: Dict with health assessment and recommendations """ if not IS_ARCH: return create_error_response( "NotSupported", "This feature is only available on Arch Linux" ) logger.info("Checking mirrorlist health") try: issues = [] warnings = [] recommendations = [] # Get active mirrors result = await list_active_mirrors() if "error" in result: return result active_mirrors = result.get("active_mirrors", []) # Check: No active mirrors if len(active_mirrors) == 0: issues.append("No active mirrors configured") recommendations.append("Uncomment mirrors in /etc/pacman.d/mirrorlist or use reflector to generate a new mirrorlist") # Check: Only one active mirror (no redundancy) elif len(active_mirrors) == 1: warnings.append("Only one active mirror (no redundancy)") recommendations.append("Enable additional mirrors for redundancy") # Check: Too many active mirrors (can slow down updates) elif len(active_mirrors) > 10: warnings.append(f"Many active mirrors ({len(active_mirrors)}) may slow down updates") recommendations.append("Consider reducing to 3-5 fastest mirrors") # Test mirrors test_result = await test_mirror_speed() if "error" not in test_result: test_results = test_result.get("results", []) # Check: All mirrors failing successful_mirrors = [r for r in test_results if r.get("success", False)] if len(successful_mirrors) == 0: issues.append("All mirrors are unreachable or failing") recommendations.append("Check network connectivity and consider updating mirrorlist") # Check: High latency elif successful_mirrors: avg_latency = sum(m["latency_ms"] for m in successful_mirrors) / len(successful_mirrors) if avg_latency > 1000: warnings.append(f"High average mirror latency ({avg_latency:.0f}ms)") recommendations.append("Consider using geographically closer mirrors") # Health score health_score = 100 health_score -= len(issues) * 40 health_score -= len(warnings) * 15 health_score = max(0, health_score) health_status = "healthy" if health_score < 50: health_status = "critical" elif health_score < 70: health_status = "warning" logger.info(f"Mirror health: {health_status} (score: {health_score})") return { "health_status": health_status, "health_score": health_score, "issues": issues, "warnings": warnings, "recommendations": recommendations, "active_mirrors_count": len(active_mirrors) } except Exception as e: logger.error(f"Failed to check mirror health: {e}") return create_error_response( "HealthCheckError", f"Failed to check mirrorlist health: {str(e)}" )
  • MCP tool registration in list_tools(), defining the tool name, description, and empty input schema (no parameters required).
    Tool( name="check_mirrorlist_health", description="[MIRRORS] Verify mirror configuration health. Checks for common issues like no active mirrors, outdated mirrorlist, high latency. Only works on Arch Linux.", inputSchema={ "type": "object", "properties": {} } ),
  • Dispatch logic in call_tool() that invokes the check_mirrorlist_health implementation function and formats the JSON response for MCP.
    elif name == "check_mirrorlist_health": if not IS_ARCH: return [TextContent(type="text", text="Error: check_mirrorlist_health only available on Arch Linux systems")] result = await check_mirrorlist_health() return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Tool metadata defining category (mirrors), platform (arch), permission (read), workflow (verify), and related tools for discovery and organization purposes.
    "check_mirrorlist_health": ToolMetadata( name="check_mirrorlist_health", category="mirrors", platform="arch", permission="read", workflow="verify", related_tools=["list_active_mirrors", "suggest_fastest_mirrors"], 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