toggle_floating
Switch a window between floating and tiled modes. Specify a target window or toggle the active window's layout.
Instructions
Toggle floating mode for a window.
Args: target: Window selector. If omitted, toggles the active window.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "toggle_floating"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- hyprland_mcp/server.py:193-201 (handler)The `toggle_floating` tool handler is defined in `server.py` using the `@mcp.tool()` decorator. It dispatches a 'togglefloating' command to the Hyprland server via the `hyprctl` helper.
@mcp.tool() async def toggle_floating(target: str | None = None) -> str: """Toggle floating mode for a window. Args: target: Window selector. If omitted, toggles the active window. """ await hyprctl.dispatch("togglefloating", target or "") return f"Toggled floating{f' for {target}' if target else ''}"