list_monitors
Retrieve connected monitor details including resolution, position, and active workspace for managing multi-display setups in Hyprland desktop environments.
Instructions
List all connected monitors with resolution, position, and active workspace.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- hyprland_mcp/server.py:22-33 (handler)Implementation of the list_monitors tool. It uses hyprctl.query("monitors") to fetch monitor data and formats it into a human-readable string.
@mcp.tool() async def list_monitors() -> str: """List all connected monitors with resolution, position, and active workspace.""" monitors = await hyprctl.query("monitors") lines = [] for m in monitors: lines.append( f"- {m['name']}: {m['width']}x{m['height']}@{m['refreshRate']:.0f}Hz " f"at ({m['x']},{m['y']}), workspace {m['activeWorkspace']['name']}" f"{' [focused]' if m.get('focused') else ''}" ) return "\n".join(lines)