list_scenes
Retrieve all available lighting scenes from your LIFX account to manage and apply preset configurations for smart lights.
Instructions
List all scenes available in the account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | LIFX API token |
Implementation Reference
- src/index.ts:421-435 (handler)The handler for the 'list_scenes' tool. It extracts the LIFX token from arguments, fetches scenes via makeLIFXRequest('/scenes'), and returns a formatted text list of scenes including name, UUID, number of states, and creation date.case "list_scenes": { const { token } = args as { token: string }; const scenes = await makeLIFXRequest("/scenes", { token }); return { content: [ { type: "text", text: `Found ${scenes.length} scenes:\n\n${scenes.map((scene: LIFXScene) => `• ${scene.name} (${scene.uuid})\n States: ${scene.states.length} lights\n Created: ${new Date(scene.created_at * 1000).toLocaleDateString()}` ).join('\n\n')}`, }, ], }; }
- src/index.ts:223-233 (registration)Registration of the 'list_scenes' tool within the ListToolsRequestHandler response. Defines the tool's name, description, and input schema requiring a LIFX API token.{ name: "list_scenes", description: "List all scenes available in the account", inputSchema: { type: "object", properties: { token: { type: "string", description: "LIFX API token" }, }, required: ["token"], }, },
- src/index.ts:51-69 (schema)TypeScript interface defining the LIFXScene type, used for typing the response from the LIFX scenes API in the list_scenes handler.interface LIFXScene { uuid: string; name: string; account: { uuid: string; }; states: Array<{ selector: string; power: string; brightness: number; color: { hue: number; saturation: number; kelvin: number; }; }>; created_at: number; updated_at: number; }