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.
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": "list_workspaces"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
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)