Skip to main content
Glama

verify_package_integrity

Check installed package files for modifications, corruption, or missing components to ensure system integrity on Arch Linux systems.

Instructions

Verify the integrity of installed package files. Detects modified, missing, or corrupted files. Only works on Arch Linux.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
package_nameYesName of the package to verify
thoroughNoPerform thorough check including file attributes. Default: false

Implementation Reference

  • Core handler function that executes pacman -Qk or -Qkk to verify installed package file integrity, parses output for issues, and returns structured results.
    async def verify_package_integrity(package_name: str, thorough: bool = False) -> Dict[str, Any]: """ Verify integrity of an installed package. Args: package_name: Name of package to verify thorough: If True, perform thorough check (pacman -Qkk) Returns: Dict with verification results """ if not IS_ARCH: return create_error_response( "NotSupported", "Package verification is only available on Arch Linux" ) if not check_command_exists("pacman"): return create_error_response( "CommandNotFound", "pacman command not found" ) logger.info(f"Verifying package integrity: {package_name} (thorough={thorough})") try: cmd = ["pacman", "-Qkk" if thorough else "-Qk", package_name] exit_code, stdout, stderr = await run_command( cmd, timeout=30, check=False ) if exit_code != 0 and "was not found" in stderr: return create_error_response( "NotFound", f"Package not installed: {package_name}" ) # Parse verification output issues = [] for line in stdout.strip().split('\n'): if "warning" in line.lower() or "missing" in line.lower(): issues.append(line.strip()) logger.info(f"Found {len(issues)} issues for {package_name}") return { "package": package_name, "thorough": thorough, "issues_found": len(issues), "issues": issues, "all_ok": len(issues) == 0 } except Exception as e: logger.error(f"Package verification failed: {e}") return create_error_response( "CommandError", f"Failed to verify package: {str(e)}" )
  • MCP tool schema defining input parameters: package_name (required string) and optional thorough boolean.
    Tool( name="verify_package_integrity", description="[MAINTENANCE] Verify the integrity of installed package files. Detects modified, missing, or corrupted files. Only works on Arch Linux.", inputSchema={ "type": "object", "properties": { "package_name": { "type": "string", "description": "Name of the package to verify" }, "thorough": { "type": "boolean", "description": "Perform thorough check including file attributes. Default: false", "default": False } }, "required": ["package_name"] }
  • MCP server tool dispatcher/registration that calls the verify_package_integrity handler with parsed arguments and formats the response.
    elif name == "verify_package_integrity": if not IS_ARCH: return [TextContent(type="text", text="Error: verify_package_integrity only available on Arch Linux systems")] package_name = arguments["package_name"] thorough = arguments.get("thorough", False) result = await verify_package_integrity(package_name, thorough) return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Tool metadata providing categorization, platform requirements, permissions, and related tools for verify_package_integrity.
    "verify_package_integrity": ToolMetadata( name="verify_package_integrity", category="maintenance", platform="arch", permission="read", workflow="verify", related_tools=["get_transaction_history", "find_package_owner"], prerequisite_tools=[]
  • Import registration of verify_package_integrity function from pacman module for use across the package.
    verify_package_integrity, list_package_groups, list_group_packages, list_explicit_packages, mark_as_explicit, mark_as_dependency, check_database_freshness ) from .system import ( get_system_info, check_disk_space, get_pacman_cache_stats, check_failed_services, get_boot_logs ) from .news import ( get_latest_news, check_critical_news, get_news_since_last_update ) from .logs import ( get_transaction_history, find_when_installed, find_failed_transactions, get_database_sync_history ) from .mirrors import ( list_active_mirrors, test_mirror_speed, suggest_fastest_mirrors, check_mirrorlist_health ) from .config import ( analyze_pacman_conf, analyze_makepkg_conf, check_ignored_packages, get_parallel_downloads_setting ) from .utils import IS_ARCH, run_command # Import server from the server module from .server import server # Main function will be defined here async def main(): """ Main entry point for the MCP server. Runs the server using STDIO transport (default for Docker MCP Catalog). """ import asyncio import mcp.server.stdio import logging # Set up logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) logger.info("Starting Arch Linux MCP Server (STDIO)") logger.info(f"Running on Arch Linux: {IS_ARCH}") # Run the server using STDIO async with mcp.server.stdio.stdio_server() as (read_stream, write_stream): await server.run( read_stream, write_stream, server.create_initialization_options() ) def main_sync(): """Synchronous wrapper for the main function (STDIO transport).""" import asyncio asyncio.run(main()) def main_http_sync(): """ Main entry point for HTTP server (for Smithery). Runs the server using SSE (Server-Sent Events) HTTP transport. """ from .http_server import main_http main_http() __all__ = [ # Wiki "search_wiki", "get_wiki_page", "get_wiki_page_as_text", # AUR "search_aur", "get_aur_info", "get_pkgbuild", "get_aur_file", "analyze_pkgbuild_safety", "analyze_package_metadata_risk", "install_package_secure", # Pacman "get_official_package_info", "check_updates_dry_run", "remove_package", "remove_packages_batch", "list_orphan_packages", "remove_orphans", "find_package_owner", "list_package_files", "search_package_files", "verify_package_integrity",

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