Skip to main content
Glama
lsemenenko

OpenHue MCP Server

by lsemenenko

get-lights

List all connected Philips Hue lights or retrieve details for a specific light by ID or room. Integrates with OpenHue MCP Server for easy light management via LLM interfaces.

Instructions

List all Hue lights or get details for a specific light

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lightIdNoOptional light ID or name to get specific light details
roomNoOptional room name to filter lights

Implementation Reference

  • The handler function for the 'get-lights' tool. Constructs a 'get light' OpenHue CLI command with optional lightId or room filters, appends --json, executes it using executeHueCommand, and returns the result as text content.
    case "get-lights": {
      let command = "get light";
      if (args?.lightId) {
        command += ` "${args.lightId}"`;
      }
      if (args?.room) {
        command += ` --room "${args.room}"`;
      }
      command += " --json";
      const result = await executeHueCommand(command);
      return {
        content: [
          {
            type: "text",
            text: result,
          },
        ],
      };
    }
  • JSON input schema for the 'get-lights' tool, defining optional 'lightId' and 'room' string parameters.
    inputSchema: {
      type: "object",
      properties: {
        lightId: {
          type: "string",
          description: "Optional light ID or name to get specific light details",
        },
        room: {
          type: "string",
          description: "Optional room name to filter lights",
        },
      },
    },
  • src/index.ts:82-98 (registration)
    Tool registration in the listTools handler, specifying name, description, and inputSchema for 'get-lights'.
    {
      name: "get-lights",
      description: "List all Hue lights or get details for a specific light",
      inputSchema: {
        type: "object",
        properties: {
          lightId: {
            type: "string",
            description: "Optional light ID or name to get specific light details",
          },
          room: {
            type: "string",
            description: "Optional room name to filter lights",
          },
        },
      },
    },
  • Helper function used by 'get-lights' handler to execute OpenHue CLI commands via Docker container, capturing stdout or throwing errors.
    async function executeHueCommand(command: string): Promise<string> {
      try {
        const { stdout, stderr } = await execAsync(buildDockerCommand(command));
        if (stderr) {
          console.error("Command error:", stderr);
          throw new Error(stderr);
        }
        return stdout;
      } catch (error) {
        console.error("Execution error:", error);
        throw error;
      }
    }
  • Helper to build Docker command for running openhue/cli with mounted config, used indirectly by get-lights via executeHueCommand.
    const buildDockerCommand = (command: string) => {
      const configPath = getConfigPath();
      return `docker run -v "${configPath}:/.openhue" --rm openhue/cli ${command}`;
    };
Behavior2/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 describes a read operation ('List' and 'get details'), which implies it's non-destructive, but fails to mention any behavioral traits such as authentication needs, rate limits, error handling, or what the return format looks like (e.g., list structure or detail fields). This leaves significant gaps for an agent to understand how to interact with it effectively.

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 a single, efficient sentence that front-loads the core functionality ('List all Hue lights or get details for a specific light') with zero wasted words. It's appropriately sized for the tool's complexity and gets straight to the point, making it easy to parse quickly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool with two parameters and no structured output information. It doesn't explain what the return values look like (e.g., a list of light objects or a single light object), how errors are handled, or any dependencies like authentication. For a read operation with moderate complexity, this leaves too much undefined for reliable agent use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters ('lightId' and 'room') with clear descriptions. The description adds marginal value by hinting at the dual functionality (listing vs. retrieving details) related to 'lightId', but doesn't provide additional syntax, format details, or clarify interactions between parameters beyond what the schema states. This meets the baseline for high schema coverage.

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 tool's purpose with specific verbs ('List' and 'get details') and resources ('Hue lights' or 'specific light'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-rooms' or 'get-scenes' beyond mentioning lights specifically, which is a minor gap.

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 through its phrasing ('List all... or get details for a specific light'), suggesting it can be used for both listing and retrieving details. However, it provides no explicit guidance on when to use this tool versus alternatives like 'control-light' or 'get-rooms', nor does it mention prerequisites or exclusions, leaving usage context somewhat vague.

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

Related 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/lsemenenko/openhue-mcp-server'

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