Skip to main content
Glama

list_hue_lights

Retrieve a formatted list of all Philips Hue lights with their IDs, names, and current states to identify and manage connected lighting devices.

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:130-155 (handler)
    The handler function for the 'list_hue_lights' MCP tool. Decorated with @mcp.tool() for automatic registration. Lists all Hue lights with ID, name, state, and brightness by connecting to the Hue Bridge.
    @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)}"
  • main.py:30-45 (helper)
    Helper function used by list_hue_lights to establish and cache the connection to the Philips Hue Bridge.
    def get_bridge() -> Bridge: """Get or initialize the Hue Bridge connection.""" global _bridge_instance if not BRIDGE_IP: raise ValueError( "HUE_BRIDGE_IP environment variable not set. " "Please set it to your Hue Bridge IP address." ) # Reuse existing connection or create new one if _bridge_instance is None: _bridge_instance = Bridge(BRIDGE_IP) return _bridge_instance
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tebinraouf/hue-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server