Skip to main content
Glama
lsemenenko

OpenHue MCP Server

by lsemenenko

control-light

Turn Philips Hue lights on or off, adjust brightness, set color, or change temperature using the OpenHue MCP Server for precise light control.

Instructions

Control a specific Hue light

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesTurn light on or off
brightnessNoOptional brightness level (0-100)
colorNoOptional color name (e.g., 'red', 'blue')
targetYesLight ID or name
temperatureNoOptional color temperature in Mirek

Implementation Reference

  • Handler for the 'control-light' tool. Parses input arguments using LightActionSchema, constructs an OpenHue CLI command to control the specified light (on/off, brightness, color, temperature), executes it via Docker, and returns a success message.
    case "control-light": {
      const params = LightActionSchema.parse(args);
      let command = `set light "${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 light "${params.target}" to ${params.action}`,
          },
        ],
      };
    }
  • Zod schema used to validate and parse the input parameters for the 'control-light' tool in the handler.
    const LightActionSchema = 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:99-133 (registration)
    Registration of the 'control-light' tool in the list returned by ListToolsRequestSchema, including name, description, and input schema definition.
    {
      name: "control-light",
      description: "Control a specific Hue light",
      inputSchema: {
        type: "object",
        properties: {
          target: {
            type: "string",
            description: "Light ID or name",
          },
          action: {
            type: "string",
            enum: ["on", "off"],
            description: "Turn light on or off",
          },
          brightness: {
            type: "number",
            minimum: 0,
            maximum: 100,
            description: "Optional brightness level (0-100)",
          },
          color: {
            type: "string",
            description: "Optional color name (e.g., 'red', 'blue')",
          },
          temperature: {
            type: "number",
            minimum: 153,
            maximum: 500,
            description: "Optional color temperature in Mirek",
          },
        },
        required: ["target", "action"],
      },
    },
  • Helper function that executes OpenHue CLI commands via Docker, used by the control-light handler to perform the actual light control.
    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 full burden for behavioral disclosure but only states 'Control a specific Hue light' without elaborating on effects, permissions, rate limits, or error conditions. It doesn't clarify if changes are immediate, reversible, or require specific authentication. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a tool with well-documented parameters in the schema. Every word earns its place.

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?

For a mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like side effects, error handling, or return values. While the schema covers parameters well, the description fails to compensate for the lack of annotations and output schema, leaving gaps in understanding the tool's full context.

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 all parameters are documented in the schema. The description adds no additional meaning beyond implying 'control' involves the parameters listed. It doesn't explain interactions between parameters (e.g., if 'color' overrides 'temperature') or provide usage examples. Baseline 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 'Control a specific Hue light' clearly states the verb (control) and resource (Hue light), making the purpose immediately understandable. It distinguishes from siblings like 'activate-scene' or 'get-lights' by focusing on individual light control rather than scenes or retrieval operations. However, it doesn't specify what 'control' entails beyond the schema parameters.

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-room' or 'activate-scene'. It doesn't mention prerequisites (e.g., needing light IDs from 'get-lights'), exclusions, or comparative contexts. The agent must infer usage solely from the tool name and schema.

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