Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

focus_window

Focus a specific window in Hyprland by class or title to manage desktop automation tasks. Use window selectors like "class:firefox" or "title:My Document" to target windows.

Instructions

Focus a window by class or title.

Args: target: Window selector — "class:firefox", "title:My Document", etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'focus_window' tool is defined as an async function in 'server.py' using the 'mcp.tool()' decorator. It takes a 'target' string and calls 'hyprctl.dispatch("focuswindow", target)' to execute the focus action via Hyprland.
    @mcp.tool()
    async def focus_window(target: str) -> str:
        """Focus a window by class or title.
    
        Args:
            target: Window selector — "class:firefox", "title:My Document", etc.
        """
        await hyprctl.dispatch("focuswindow", target)
        return f"Focused window matching '{target}'"
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 states the action ('focus a window') but lacks behavioral details: does it fail if the window doesn't exist? Does it require specific permissions? Is it idempotent? What happens on multi-monitor setups? The description is minimal and misses key operational context for a mutation tool.

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 extremely concise and front-loaded: the first sentence states the core purpose, followed by a brief 'Args' section with a clear explanation and examples. Every sentence earns its place with no wasted words, making it easy to parse quickly.

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 1 parameter with 0% schema coverage, the description adequately covers parameter semantics. However, as a mutation tool with no annotations and an output schema (existence noted but content unknown), it lacks behavioral transparency and usage guidelines. The description is minimal but functional, leaving gaps in operational context.

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%, but the description compensates well. It explains the single parameter 'target' as a 'window selector' with examples ('class:firefox', 'title:My Document', etc.), adding crucial syntax and format details beyond the bare schema. This effectively documents the parameter despite the schema gap.

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 verb ('focus') and resource ('a window'), specifying it works by 'class or title'. It distinguishes from siblings like 'get_active_window' (which reads) or 'close_window' (which destroys), but doesn't explicitly contrast with similar tools like 'move_window' or 'resize_window' that also target windows. The purpose is specific and actionable.

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

Usage Guidelines3/5

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

The description implies usage when you need to bring a window to the foreground, but provides no explicit guidance on when to use this versus alternatives like 'get_active_window' for inspection or 'switch_workspace' for context switching. It lacks prerequisites (e.g., window must exist) or exclusions (e.g., not for minimized windows). Usage is contextually implied but not detailed.

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