Skip to main content
Glama

check_system_dependencies

Verify required system dependencies are installed for the Auto-Snap MCP server to automate screenshot capture and document processing.

Instructions

Check if all required system dependencies are installed.

Returns:
    JSON string with dependency check results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for the 'check_system_dependencies' tool. Decorated with @mcp.tool() for registration. Orchestrates dependency checks using imported helpers and formats results as JSON.
    @mcp.tool()
    async def check_system_dependencies() -> str:
        """
        Check if all required system dependencies are installed.
        
        Returns:
            JSON string with dependency check results.
        """
        try:
            missing_deps = check_dependencies()
            tesseract_available = check_tesseract()
            
            result = {
                "status": "success",
                "dependencies": {
                    "wmctrl": "wmctrl" not in missing_deps,
                    "xdotool": "xdotool" not in missing_deps,
                    "tesseract": tesseract_available
                },
                "missing_dependencies": missing_deps,
                "install_commands": {
                    "wmctrl": "sudo apt-get install wmctrl",
                    "xdotool": "sudo apt-get install xdotool",
                    "tesseract": "sudo apt-get install tesseract-ocr"
                }
            }
            
            if missing_deps or not tesseract_available:
                result["status"] = "warning"
                result["message"] = "Some dependencies are missing"
            
            return json.dumps(result, indent=2)
            
        except Exception as e:
            logger.error(f"Failed to check dependencies: {e}")
            return json.dumps({
                "status": "error",
                "error": str(e)
            })
  • Helper function that checks availability of Linux window management tools wmctrl and xdotool, called by the main handler.
    def check_dependencies() -> List[str]:
        """
        Check if required system dependencies are installed.
        Returns list of missing dependencies.
        """
        missing = []
        
        # Check for wmctrl
        try:
            subprocess.run(['wmctrl', '--version'], capture_output=True, check=True, timeout=5)
        except (subprocess.CalledProcessError, FileNotFoundError, subprocess.TimeoutExpired):
            missing.append('wmctrl')
        
        # Check for xdotool
        try:
            subprocess.run(['xdotool', '--version'], capture_output=True, check=True, timeout=5)
        except (subprocess.CalledProcessError, FileNotFoundError, subprocess.TimeoutExpired):
            missing.append('xdotool')
        
        return missing
  • Helper function that verifies Tesseract OCR installation via pytesseract, used by the main handler.
    def check_tesseract() -> bool:
        """
        Check if Tesseract OCR is installed and accessible.
        
        Returns:
            True if Tesseract is available, False otherwise
        """
        try:
            import signal
            
            def timeout_handler(signum, frame):
                raise TimeoutError("Tesseract check timed out")
            
            # Set timeout for tesseract check
            signal.signal(signal.SIGALRM, timeout_handler)
            signal.alarm(10)  # 10 second timeout
            
            try:
                pytesseract.get_tesseract_version()
                return True
            finally:
                signal.alarm(0)  # Cancel the alarm
                
        except (TimeoutError, Exception) as e:
            logger.error(f"Tesseract not available: {e}")
            return False

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/PovedaAqui/auto-snap-mcp'

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