get-scenes
Retrieve and list all Philips Hue scenes or filter by room for specific details using the OpenHue MCP Server. Simplify light scene management.
Instructions
List all scenes or get details for specific scenes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| room | No | Optional room name to filter scenes |
Implementation Reference
- src/index.ts:311-326 (handler)Handler for the 'get-scenes' tool: constructs OpenHue CLI command 'get scene' optionally with --room filter, executes it, and returns the JSON output as text content.case "get-scenes": { let command = "get scene"; if (args?.room) { command += ` --room "${args.room}"`; } command += " --json"; const result = await executeHueCommand(command); return { content: [ { type: "text", text: result, }, ], }; }
- src/index.ts:182-194 (registration)Registration of the 'get-scenes' tool in the ListToolsRequestHandler response, defining its name, description, and input schema.{ name: "get-scenes", description: "List all scenes or get details for specific scenes", inputSchema: { type: "object", properties: { room: { type: "string", description: "Optional room name to filter scenes", }, }, }, },
- src/index.ts:64-76 (helper)Helper function used by get-scenes handler to execute OpenHue Docker CLI commands and return stdout.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; } }