Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

list_windows

Retrieve details of open windows including class, title, size, and position. Filter results by workspace or monitor to manage desktop layouts.

Instructions

List all open windows with class, title, size, and position.

Args: workspace: Filter to a specific workspace number monitor: Filter to a specific monitor name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceNo
monitorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The list_windows tool handler function in hyprland_mcp/server.py. It retrieves window data via hyprctl and filters them by workspace or monitor if provided.
    @mcp.tool()
    async def list_windows(workspace: int | None = None, monitor: str | None = None) -> str:
        """List all open windows with class, title, size, and position.
    
        Args:
            workspace: Filter to a specific workspace number
            monitor: Filter to a specific monitor name
        """
        clients = await hyprctl.query("clients")
        if workspace is not None:
            clients = [c for c in clients if c["workspace"]["id"] == workspace]
        if monitor is not None:
            clients = [c for c in clients if c["monitor"] == monitor]
        if not clients:
            return "No windows found matching the filter."
        lines = []
        for c in clients:
            focused = " [focused]" if c.get("focusHistoryID") == 0 else ""
            lines.append(
                f"- [{c['class']}] \"{c['title']}\" — "
                f"{c['size'][0]}x{c['size'][1]} at ({c['at'][0]},{c['at'][1]}), "
                f"workspace {c['workspace']['name']}{focused}"
            )
        return "\n".join(lines)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It describes what the tool does but lacks behavioral details like whether it requires permissions, how it handles multiple desktops, if it's read-only, performance characteristics, or error conditions. For a tool that interacts with system windows, this is a significant gap.

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 front-loaded with the core purpose in the first sentence, followed by a clean 'Args:' section. Every sentence earns its place with no wasted words, making it easy to scan and understand quickly.

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?

Given the tool's moderate complexity (listing system windows), no annotations, and an output schema exists (so return values are documented elsewhere), the description is reasonably complete. It covers purpose and parameters well but could benefit from more behavioral context given the lack of annotations.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics by explaining that 'workspace' filters to a specific workspace number and 'monitor' filters to a specific monitor name, which clarifies beyond the schema's generic titles. However, it doesn't specify format details (e.g., monitor name conventions).

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 specific verb ('List') and resource ('all open windows') with detailed attributes (class, title, size, position). It distinguishes itself from siblings like 'get_active_window' (which gets only the active window) and 'list_monitors'/'list_workspaces' (which list different resources).

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 for when to use it (to list open windows with specific attributes) and includes optional filtering parameters. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings (e.g., 'get_active_window' for just the active window).

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