Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

screenshot

Capture screen images with coordinate mapping for Hyprland desktop automation. Supports full desktop, window, or region capture and provides pixel-to-screen coordinate conversion for mouse tools.

Instructions

Take a screenshot and return it as an inline image with coordinate mapping.

Returns the image AND a coordinate mapping guide so you can convert image pixel positions to absolute screen coordinates for mouse tools.

Supports three capture modes:

  • Full desktop/monitor (default): overview at reduced resolution

  • Window: capture a specific window by class/title

  • Region: capture a specific rectangle at higher resolution

Args: monitor: Capture a specific monitor (e.g. "DP-1"). Default: all monitors. window: Capture a specific window by selector (e.g. "class:firefox") region: Capture a region as "X,Y WxH" (e.g. "100,200 800x600") max_width: Maximum output width in pixels (default 1024, lower = smaller output) quality: JPEG quality 1-100 (default 60, lower = smaller output) include_cursor: Whether to include the cursor in the screenshot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
monitorNo
windowNo
regionNo
max_widthNo
qualityNo
include_cursorNo

Implementation Reference

  • The actual implementation of taking a screenshot and preparing the coordinate mapping.
    async def take_screenshot(
        monitor: str | None = None,
        window: str | None = None,
        region: str | None = None,
        max_width: int = 1024,
        quality: int = 60,
        include_cursor: bool = False,
    ) -> tuple[Image, str]:
        """Capture a screenshot, resize to fit max_width.
    
        Returns (Image, coordinate_info_string) where coordinate_info_string
        explains how to map image pixel positions to absolute screen coordinates.
        """
        png_bytes, origin_x, origin_y = await capture_raw(
            monitor=monitor, window=window, region=region, include_cursor=include_cursor,
        )
    
        # Get native dimensions before resize
        native_img = PILImage.open(io.BytesIO(png_bytes))
        native_w, native_h = native_img.width, native_img.height
    
        image, scale = resize_and_compress(png_bytes, max_width=max_width, quality=quality)
    
        # Build coordinate mapping info
        img_w = int(native_w * scale) if scale != 1.0 else native_w
        img_h = int(native_h * scale) if scale != 1.0 else native_h
        inv_scale = 1.0 / scale if scale != 1.0 else 1.0
    
        coord_info = (
            f"Coordinate mapping: This {img_w}x{img_h} image covers screen region "
            f"starting at absolute ({origin_x}, {origin_y}), "
            f"native size {native_w}x{native_h}.\n"
            f"To convert image coordinates to absolute screen coordinates:\n"
            f"  screen_x = image_x * {inv_scale:.2f} + {origin_x}\n"
            f"  screen_y = image_y * {inv_scale:.2f} + {origin_y}\n"
            f"IMPORTANT: Always use absolute screen coordinates with mouse tools, "
            f"never raw image pixel positions."
        )
    
        return image, coord_info
  • The registration of the "screenshot" tool in the MCP server.
    async def screenshot(
        monitor: str | None = None,
        window: str | None = None,
        region: str | None = None,
        max_width: int = 1024,
        quality: int = 60,
        include_cursor: bool = False,
    ) -> list:
        """Take a screenshot and return it as an inline image with coordinate mapping.
    
        Returns the image AND a coordinate mapping guide so you can convert image
        pixel positions to absolute screen coordinates for mouse tools.
    
        Supports three capture modes:
        - Full desktop/monitor (default): overview at reduced resolution
        - Window: capture a specific window by class/title
        - Region: capture a specific rectangle at higher resolution
    
        Args:
            monitor: Capture a specific monitor (e.g. "DP-1"). Default: all monitors.
            window: Capture a specific window by selector (e.g. "class:firefox")
            region: Capture a region as "X,Y WxH" (e.g. "100,200 800x600")
            max_width: Maximum output width in pixels (default 1024, lower = smaller output)
            quality: JPEG quality 1-100 (default 60, lower = smaller output)
            include_cursor: Whether to include the cursor in the screenshot
        """
        from . import screenshot as ss
        image, coord_info = await ss.take_screenshot(
            monitor=monitor,
            window=window,
            region=region,
            max_width=max_width,
            quality=quality,
            include_cursor=include_cursor,
        )
        return [image, coord_info]
Behavior4/5

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

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It does an excellent job describing what the tool returns (image + coordinate mapping), the three capture modes with their characteristics, and default behaviors. It explains resolution differences between modes and output size/quality tradeoffs. The only minor gap is not mentioning potential failure modes or performance characteristics.

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

Conciseness5/5

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

The description is perfectly structured and concise. It starts with the core purpose, explains the return value, lists capture modes, then details each parameter with clear formatting. Every sentence adds value with no redundancy. The bullet points and parameter explanations are efficiently organized for quick comprehension.

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

Completeness4/5

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

For a 6-parameter tool with no annotations and no output schema, the description provides excellent coverage of inputs, behaviors, and outputs. It explains what the tool returns (image + coordinate mapping) and how to interpret it. The only minor gap is not explicitly describing the exact format of the coordinate mapping or providing example return values, which would be helpful given the lack of output schema.

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

Parameters5/5

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

With 0% schema description coverage, the description must fully compensate, which it does excellently. It provides detailed explanations for all 6 parameters: what each controls, default values, format examples (e.g., '100,200 800x600'), value ranges (quality 1-100), and practical implications (lower quality = smaller output). The description adds substantial meaning beyond what the bare schema provides.

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

Purpose5/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: 'Take a screenshot and return it as an inline image with coordinate mapping.' It specifies the exact action (take screenshot) and output format (inline image with coordinate mapping), distinguishing it from sibling tools like 'screenshot_with_ocr' which implies OCR functionality. The description goes beyond just restating the name by explaining the coordinate mapping feature.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool by explaining the three capture modes (full desktop, window, region) and their purposes. It distinguishes between default behavior and specialized options. However, it doesn't explicitly mention when NOT to use it or name specific alternatives like 'screenshot_with_ocr' for when OCR is needed, which prevents a perfect score.

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/alderban107/hyprland-mcp'

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