Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

close_window

Close windows in Hyprland desktop environments. Specify a target window or close the active window directly. Sends WM_CLOSE signal, allowing applications to show save dialogs when needed.

Instructions

Close a window (sends WM_CLOSE — apps can show save dialogs).

Args: target: Window selector (e.g. "class:firefox"). If omitted, closes the active window.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `close_window` function is defined here as an MCP tool, which calls `hyprctl.dispatch("closewindow", target or "")` to interface with the Hyprland compositor.
    @mcp.tool()
    async def close_window(target: str | None = None) -> str:
        """Close a window (sends WM_CLOSE — apps can show save dialogs).
    
        Args:
            target: Window selector (e.g. "class:firefox"). If omitted, closes the active window.
        """
        await hyprctl.dispatch("closewindow", target or "")
        return f"Closed window{f' matching {target!r}' if target else ' (active)'}"
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it sends WM_CLOSE (implying a graceful close request) and notes that apps can show save dialogs (important side effect). It doesn't mention permissions, rate limits, or error conditions, but covers the core mutation behavior adequately.

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 concise Args section. Every sentence earns its place by providing essential information without redundancy, making it highly efficient.

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 (mutation with one parameter), no annotations, and an output schema present, the description is mostly complete. It explains what the tool does, parameter usage, and behavioral implications, though it could briefly mention what the output might contain (e.g., success/failure status) since output schema exists but isn't described here.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the 'target' parameter as a 'Window selector' with an example ('class:firefox') and clarifies the default behavior when omitted. This fully compensates for the schema's lack of documentation.

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 action ('Close a window') and the mechanism ('sends WM_CLOSE — apps can show save dialogs'), distinguishing it from siblings like focus_window or move_window. It specifies the exact behavior rather than just restating the name.

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 (closing windows) and includes a default behavior (closes active window if target omitted). However, it doesn't explicitly state when not to use it or name alternatives among siblings like toggle_fullscreen for different window actions.

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