Skip to main content
Glama
lsemenenko

OpenHue MCP Server

by lsemenenko

get-rooms

Retrieve details of all rooms or a specific room in your Philips Hue setup using the OpenHue MCP Server. Ideal for managing and controlling room-specific lighting configurations.

Instructions

List all rooms or get details for a specific room

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roomIdNoOptional room ID or name to get specific room details

Implementation Reference

  • Handler for the 'get-rooms' tool. Constructs an OpenHue 'get room' command, optionally including a specific roomId, appends '--json', executes it using executeHueCommand, and returns the result as text content.
    case "get-rooms": {
      let command = "get room";
      if (args?.roomId) {
        command += ` "${args.roomId}"`;
      }
      command += " --json";
      const result = await executeHueCommand(command);
      return {
        content: [
          {
            type: "text",
            text: result,
          },
        ],
      };
    }
  • src/index.ts:134-146 (registration)
    Registration of the 'get-rooms' tool in the ListTools response, including its name, description, and input schema (optional roomId string).
    {
      name: "get-rooms",
      description: "List all rooms or get details for a specific room",
      inputSchema: {
        type: "object",
        properties: {
          roomId: {
            type: "string",
            description: "Optional room ID or name to get specific room details",
          },
        },
      },
    },
  • Helper function used by get-rooms (and other tools) to execute OpenHue Docker commands and return stdout or throw 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;
      }
    }

Tool Definition Quality

Score is being calculated. Check back soon.

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