Skip to main content
Glama
lsemenenko

OpenHue MCP Server

by lsemenenko

control-room

Manage room lighting by turning lights on or off, adjusting brightness, color, and temperature using the OpenHue MCP Server. Simplify control for Philips Hue systems.

Instructions

Control all lights in a room

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesTurn room lights on or off
brightnessNoOptional brightness level (0-100)
colorNoOptional color name
targetYesRoom ID or name
temperatureNoOptional color temperature in Mirek

Implementation Reference

  • The main handler for the 'control-room' tool. It validates input using RoomActionSchema, constructs an OpenHue CLI command to control room lights (on/off, brightness, color, temperature), executes it via executeHueCommand, and returns a success message.
    case "control-room": {
      const params = RoomActionSchema.parse(args);
      let command = `set room "${params.target}" --${params.action}`;
      if (params.brightness !== undefined) {
        command += ` --brightness ${params.brightness}`;
      }
      if (params.color) {
        command += ` --color ${params.color}`;
      }
      if (params.temperature) {
        command += ` --temperature ${params.temperature}`;
      }
      await executeHueCommand(command);
      return {
        content: [
          {
            type: "text",
            text: `Successfully set room "${params.target}" to ${params.action}`,
          },
        ],
      };
    }
  • Zod schema used to parse and validate the input arguments for the 'control-room' tool in the handler.
    const RoomActionSchema = z.object({
      target: z.string(),
      action: z.enum(["on", "off"]),
      brightness: z.number().min(0).max(100).optional(),
      color: z.string().optional(),
      temperature: z.number().min(153).max(500).optional(),
    });
  • src/index.ts:147-181 (registration)
    Tool registration in the ListTools handler, providing the tool's name, description, and JSON input schema for MCP clients.
    {
      name: "control-room",
      description: "Control all lights in a room",
      inputSchema: {
        type: "object",
        properties: {
          target: {
            type: "string",
            description: "Room ID or name",
          },
          action: {
            type: "string",
            enum: ["on", "off"],
            description: "Turn room lights on or off",
          },
          brightness: {
            type: "number",
            minimum: 0,
            maximum: 100,
            description: "Optional brightness level (0-100)",
          },
          color: {
            type: "string",
            description: "Optional color name",
          },
          temperature: {
            type: "number",
            minimum: 153,
            maximum: 500,
            description: "Optional color temperature in Mirek",
          },
        },
        required: ["target", "action"],
      },
    },
  • Helper function called by the handler to execute the constructed OpenHue CLI command via Docker.
    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;
      }
    }
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 states 'control all lights in a room', implying a write/mutation operation, but doesn't specify permissions needed, side effects (e.g., if it overrides individual light settings), error handling, or rate limits. This is a significant gap for a tool with potential destructive effects.

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 directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent 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 tool's complexity (controlling multiple lights with multiple parameters), lack of annotations, and no output schema, the description is insufficient. It doesn't address behavioral aspects like permissions, side effects, or return values, leaving critical gaps for safe and effective tool invocation.

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?

The schema description coverage is 100%, providing clear documentation for all 5 parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain how 'brightness' interacts with 'action' or clarify 'target' formats). The baseline score of 3 is appropriate when the schema does the heavy lifting.

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 ('control') and resource ('all lights in a room'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'control-light' (individual light control) or 'activate-scene' (scene-based control), which would be needed for a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'control-light' or 'activate-scene'. It lacks context about prerequisites (e.g., room identification) or exclusions, leaving the agent to infer usage from the tool name and parameters alone.

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