list_workspaces
Retrieve active workspaces and their window counts to manage desktop organization and monitor application distribution across displays.
Instructions
List all active workspaces with window counts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- hyprland_mcp/server.py:36-47 (handler)The list_workspaces tool handler, which queries workspace data from hyprctl, sorts it, and formats it into a list string.
@mcp.tool() async def list_workspaces() -> str: """List all active workspaces with window counts.""" workspaces = await hyprctl.query("workspaces") workspaces.sort(key=lambda w: w["id"]) lines = [] for w in workspaces: lines.append( f"- Workspace {w['name']} (id={w['id']}): " f"{w['windows']} window(s), monitor {w['monitor']}" ) return "\n".join(lines)