Skip to main content
Glama

activate-scene

Use this tool to activate a specific Philips Hue lighting scene by providing the scene name or ID, with optional room name and mode settings. Part of the OpenHue MCP Server for controlling lights via CLI.

Instructions

Activate a specific scene

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoOptional scene mode
nameYesScene name or ID
roomNoOptional room name for the scene

Implementation Reference

  • Handler for 'activate-scene' tool: parses arguments using SceneActionSchema, constructs OpenHue CLI command to activate the scene, executes it via Docker, and returns a success message.
    case "activate-scene": { const params = SceneActionSchema.parse(args); let command = `set scene "${params.name}"`; if (params.room) { command += ` --room "${params.room}"`; } if (params.mode) { command += ` --action ${params.mode}`; } await executeHueCommand(command); return { content: [ { type: "text", text: `Successfully activated scene "${params.name}"`, }, ], }; }
  • Zod schema for validating input parameters of the 'activate-scene' tool: requires scene name, optional room and mode.
    const SceneActionSchema = z.object({ name: z.string(), room: z.string().optional(), mode: z.enum(["active", "dynamic", "static"]).optional(), });
  • src/index.ts:195-217 (registration)
    Tool registration in ListTools response: defines name, description, and JSON input schema for 'activate-scene'.
    { name: "activate-scene", description: "Activate a specific scene", inputSchema: { type: "object", properties: { name: { type: "string", description: "Scene name or ID", }, room: { type: "string", description: "Optional room name for the scene", }, mode: { type: "string", enum: ["active", "dynamic", "static"], description: "Optional scene mode", }, }, required: ["name"], }, },
  • Helper function to execute OpenHue commands via Docker, used by the 'activate-scene' handler.
    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; } }

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