Skip to main content
Glama

check_ignored_packages

Identify packages excluded from system updates in pacman.conf and detect if critical system packages are being ignored on Arch Linux systems.

Instructions

List packages ignored in updates from pacman.conf. Warns if critical system packages are ignored. Only works on Arch Linux.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function implementing the check_ignored_packages tool. It analyzes pacman.conf for IgnorePkg and IgnoreGroup settings, identifies critical ignored packages, and returns structured results with warnings.
    async def check_ignored_packages() -> Dict[str, Any]: """ List packages ignored in updates. Returns: Dict with ignored packages and groups """ if not IS_ARCH: return create_error_response( "NotSupported", "This feature is only available on Arch Linux" ) logger.info("Checking ignored packages") try: result = await analyze_pacman_conf() if "error" in result: return result ignored_packages = result.get("ignored_packages", []) ignored_groups = result.get("ignored_groups", []) # Warnings for critical packages critical_packages = ["linux", "systemd", "pacman", "glibc"] critical_ignored = [pkg for pkg in ignored_packages if pkg in critical_packages] warnings = [] if critical_ignored: warnings.append(f"Critical system packages are ignored: {', '.join(critical_ignored)}") logger.info(f"Found {len(ignored_packages)} ignored packages, {len(ignored_groups)} ignored groups") return { "ignored_packages": ignored_packages, "ignored_packages_count": len(ignored_packages), "ignored_groups": ignored_groups, "ignored_groups_count": len(ignored_groups), "critical_ignored": critical_ignored, "warnings": warnings, "has_ignored": len(ignored_packages) > 0 or len(ignored_groups) > 0 } except Exception as e: logger.error(f"Failed to check ignored packages: {e}") return create_error_response( "ConfigCheckError", f"Failed to check ignored packages: {str(e)}" )
  • MCP tool registration in list_tools(), defining the tool name, description, and empty input schema (no parameters required).
    Tool( name="check_ignored_packages", description="[CONFIG] List packages ignored in updates from pacman.conf. Warns if critical system packages are ignored. Only works on Arch Linux.", inputSchema={ "type": "object", "properties": {} } ),
  • Input schema definition for the tool: empty object since no input parameters are required.
    inputSchema={ "type": "object", "properties": {} }
  • Tool dispatch handler in call_tool() that invokes the check_ignored_packages function and formats the response as JSON.
    elif name == "check_ignored_packages": if not IS_ARCH: return [TextContent(type="text", text="Error: check_ignored_packages only available on Arch Linux systems")] result = await check_ignored_packages() return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Supporting helper function analyze_pacman_conf() called by the handler to parse pacman.conf and extract ignored packages and other config.
    async def analyze_pacman_conf() -> Dict[str, Any]: """ Parse and analyze pacman.conf. Returns: Dict with parsed pacman configuration """ if not IS_ARCH: return create_error_response( "NotSupported", "This feature is only available on Arch Linux" ) logger.info("Analyzing pacman.conf") try: pacman_conf = Path(PACMAN_CONF) if not pacman_conf.exists(): return create_error_response( "NotFound", f"pacman.conf not found at {PACMAN_CONF}" ) config = parse_config_file(PACMAN_CONF) # Extract specific important options options = config.get("options", {}) # Parse multi-value options ignored_packages = [] ignored_groups = [] for key, value in options.items(): if key == "IgnorePkg": ignored_packages = [p.strip() for p in value.split()] elif key == "IgnoreGroup": ignored_groups = [g.strip() for g in value.split()] # Parse ParallelDownloads parallel_downloads = options.get("ParallelDownloads", "1") try: parallel_downloads = int(parallel_downloads) except ValueError: parallel_downloads = 1 # Extract repository list repositories = [repo["name"] for repo in config.get("repositories", [])] # Check for security settings sig_level = options.get("SigLevel", "") local_file_sig_level = options.get("LocalFileSigLevel", "") logger.info(f"Parsed pacman.conf: {len(repositories)} repos, {parallel_downloads} parallel downloads") return { "config_path": str(pacman_conf), "repositories": repositories, "repository_count": len(repositories), "parallel_downloads": parallel_downloads, "ignored_packages": ignored_packages, "ignored_groups": ignored_groups, "sig_level": sig_level, "local_file_sig_level": local_file_sig_level, "all_options": options, "raw_config": config } except Exception as e: logger.error(f"Failed to analyze pacman.conf: {e}") return create_error_response( "ConfigParseError", f"Failed to analyze pacman.conf: {str(e)}" )

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