Skip to main content
Glama
tebinraouf
by tebinraouf

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists lights and describes the return format, which is helpful. However, it lacks details on potential side effects, authentication requirements, rate limits, or error conditions that would be important for a tool interacting with hardware.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences: one stating the purpose and one describing the return format. Every word earns its place with zero redundancy, and the information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no parameters, an output schema exists, and it's a read-only listing operation, the description provides adequate context. It explains what the tool does and what it returns, though additional behavioral context (like authentication needs) would be beneficial since no annotations are provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of inputs. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose and output. This meets the baseline expectation for parameterless tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all available Philips Hue lights'), making the purpose specific and understandable. It distinguishes from the sibling 'change_hue_light' by focusing on listing rather than modifying, though it doesn't explicitly mention this distinction in the text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving light information, but provides no explicit guidance on when to use this tool versus alternatives like 'change_hue_light'. There's no mention of prerequisites, timing considerations, or comparative context with the sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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