Skip to main content
Glama

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
NameRequiredDescriptionDefault
tokenYesLIFX API token

Implementation Reference

  • 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"], }, },
  • 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; }

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/lenvolk/mcp-lifx'

If you have feedback or need assistance with the MCP directory API, please join our Discord server