Skip to main content
Glama

capture_full_screen

Take a screenshot of your entire screen and save it as an image file for documentation or sharing purposes.

Instructions

Capture screenshot of the entire screen.

Args:
    output_path: Optional path to save the screenshot

Returns:
    JSON string with capture results and file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
output_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary MCP tool handler and registration for 'capture_full_screen'. Initializes window manager and delegates capture, returns JSON results with file info.
    @mcp.tool()
    async def capture_full_screen(output_path: Optional[str] = None) -> str:
        """
        Capture screenshot of the entire screen.
        
        Args:
            output_path: Optional path to save the screenshot
        
        Returns:
            JSON string with capture results and file path.
        """
        try:
            wm = get_window_manager()
            captured_path = wm.capture_full_screen(output_path)
            
            result = {
                "status": "success",
                "output_path": captured_path,
                "file_exists": Path(captured_path).exists(),
                "file_size_mb": round(Path(captured_path).stat().st_size / (1024 * 1024), 2)
            }
            
            return json.dumps(result, indent=2)
            
        except Exception as e:
            logger.error(f"Failed to capture full screen: {e}")
            return json.dumps({
                "status": "error",
                "error": str(e),
                "output_path": output_path
            })
  • server.py:140-140 (registration)
    MCP tool registration decorator (@mcp.tool()) for capture_full_screen.
    @mcp.tool()
  • CrossPlatformWindowManager.capture_full_screen: Delegates to platform-specific manager (WindowsWindowManager or WindowCapture) or falls back to pyscreenshot.
    def capture_full_screen(self, output_path: Optional[str] = None) -> str:
        """Capture full screen screenshot."""
        if hasattr(self.manager, 'capture_full_screen'):
            return self.manager.capture_full_screen(output_path)
        else:
            # Fallback using pyscreenshot
            try:
                screenshot = ImageGrab.grab()
                
                if output_path is None:
                    timestamp = int(time.time())
                    output_path = f"screenshot_{timestamp}.png"
                
                screenshot.save(output_path)
                logger.info(f"Full screen captured: {output_path}")
                return output_path
                
            except Exception as e:
                logger.error(f"Failed to capture full screen: {e}")
                raise
  • WindowsWindowManager.capture_full_screen: Platform-specific implementation using PowerShell script to capture full screen via System.Drawing in Windows, copies back to WSL.
    def capture_full_screen(self, output_path: Optional[str] = None) -> str:
        """
        Capture full screen screenshot using PowerShell from WSL2.
        """
        if not self.powershell_available:
            raise Exception("PowerShell not available - cannot capture full screen")
        
        logger.info("Capturing full screen using PowerShell...")
        try:
            # PowerShell script to capture full screen
            ps_script = '''
            Add-Type -AssemblyName System.Windows.Forms
            Add-Type -AssemblyName System.Drawing
            
            # Get primary screen dimensions
            $primaryScreen = [System.Windows.Forms.Screen]::PrimaryScreen
            $bounds = $primaryScreen.Bounds
            
            $width = $bounds.Width
            $height = $bounds.Height
            
            Write-Verbose "Screen dimensions: ${width}x${height}"
            
            # Capture full screen
            $bitmap = New-Object System.Drawing.Bitmap($width, $height)
            $graphics = [System.Drawing.Graphics]::FromImage($bitmap)
            $graphics.CopyFromScreen(0, 0, 0, 0, [System.Drawing.Size]::new($width, $height))
            $graphics.Dispose()
            
            # Save to temporary file in Windows temp directory
            $tempPath = [System.IO.Path]::GetTempFileName() + ".png"
            $bitmap.Save($tempPath, [System.Drawing.Imaging.ImageFormat]::Png)
            $bitmap.Dispose()
            
            Write-Output $tempPath
            '''
            
            result = subprocess.run(
                ['powershell.exe', '-Command', ps_script],
                capture_output=True,
                text=True,
                check=True,
                timeout=30  # 30 second timeout for full screen capture
            )
            
            temp_windows_path = result.stdout.strip()
            if not temp_windows_path:
                raise Exception("PowerShell did not return temp file path")
            
            # Convert Windows path to WSL path
            wsl_temp_path = self._windows_path_to_wsl(temp_windows_path)
            
            if output_path is None:
                timestamp = int(time.time())
                output_path = f"fullscreen_{timestamp}.png"
            
            # Copy from Windows temp to desired location
            subprocess.run(['cp', wsl_temp_path, output_path], check=True)
            
            # Clean up Windows temp file
            subprocess.run(
                ['powershell.exe', '-Command', f'Remove-Item "{temp_windows_path}" -Force'],
                check=False  # Don't fail if cleanup fails
            )
            
            logger.info(f"Full screen captured: {output_path}")
            return output_path
            
        except subprocess.TimeoutExpired:
            logger.error("PowerShell full screen capture timed out after 30 seconds")
            raise Exception("Full screen capture timeout")
        except subprocess.CalledProcessError as e:
            logger.error(f"Failed to capture full screen: {e}")
            raise
        except Exception as e:
            logger.error(f"Full screen capture failed: {e}")
            raise
  • WindowCapture.capture_full_screen: Linux/X11 fallback implementation using pyscreenshot (ImageGrab.grab()).
    def capture_full_screen(self, output_path: Optional[str] = None) -> str:
        """
        Capture full screen screenshot.
        """
        try:
            screenshot = ImageGrab.grab()
            
            if output_path is None:
                timestamp = int(time.time())
                output_path = f"screenshot_{timestamp}.png"
            
            screenshot.save(output_path)
            logger.info(f"Full screen captured: {output_path}")
            return output_path
            
        except Exception as e:
            logger.error(f"Failed to capture full screen: {e}")
            raise
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool captures a screenshot and returns a JSON string, but fails to describe critical behaviors such as permissions needed, whether it overwrites existing files, how it handles errors, or any system dependencies. This leaves significant gaps for a tool that interacts with the system.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by brief sections for arguments and returns. Each sentence serves a clear purpose without redundancy, though the 'Args' and 'Returns' labels could be integrated more smoothly into the narrative flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (system interaction with one parameter) and the presence of an output schema (which handles return values), the description is minimally adequate. However, it lacks details on behavioral aspects like error handling or dependencies, which are important for a capture tool, making it incomplete for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and only one optional parameter, the description adds meaningful context by explaining that 'output_path' is an optional path to save the screenshot. This clarifies the parameter's purpose beyond the schema's basic type information, though it could provide more details on path formats or default behaviors.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Capture') and resource ('screenshot of the entire screen'), distinguishing it from siblings like 'capture_window' or 'capture_document_pages' which target specific screen elements. However, it doesn't explicitly mention how it differs from those siblings beyond the scope of capture.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'capture_window' or 'capture_document_pages'. It lacks context about scenarios where capturing the entire screen is preferred over more targeted captures, and does not mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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