list_hue_lights
Retrieve all Philips Hue lights connected to your Hue Bridge with their current status, IDs, and names for easy management and control.
Instructions
List all available Philips Hue lights.
Returns: A formatted list of all lights with their IDs, names, and current states
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:130-154 (handler)The main handler function for the 'list_hue_lights' MCP tool. It connects to the Philips Hue Bridge, retrieves the list of lights, and formats their IDs, names, on/off states, and brightness into a string response.@mcp.tool() def list_hue_lights() -> str: """ List all available Philips Hue lights. Returns: A formatted list of all lights with their IDs, names, and current states """ try: bridge = get_bridge() lights = bridge.lights if not lights: return "No lights found on the Hue Bridge" result = ["Available Hue Lights:", ""] for idx, light in enumerate(lights, 1): state = "ON" if light.on else "OFF" brightness = light.brightness if hasattr(light, 'brightness') else "N/A" result.append(f" {idx}. {light.name} - {state} (Brightness: {brightness})") return "\n".join(result) except Exception as e: return f"Error listing lights: {str(e)}"