Skip to main content
Glama

validate_color

Check if a color string is valid for use with LIFX smart lights before applying it to ensure proper lighting control.

Instructions

Validate a color string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesLIFX API token
colorYesColor string to validate

Implementation Reference

  • The handler function for the 'validate_color' tool. It extracts the token and color from arguments, makes a request to the LIFX /color API endpoint to validate the color, and returns the result as text content.
    case "validate_color": { const { token, color } = args as { token: string; color: string }; const result = await makeLIFXRequest(`/color?color=${encodeURIComponent(color)}`, { token }); return { content: [ { type: "text", text: `Color validation result:\n${JSON.stringify(result, null, 2)}`, }, ], }; }
  • src/index.ts:248-259 (registration)
    The registration of the 'validate_color' tool in the list_tools response, defining its name, description, and input schema.
    { name: "validate_color", description: "Validate a color string", inputSchema: { type: "object", properties: { token: { type: "string", description: "LIFX API token" }, color: { type: "string", description: "Color string to validate" }, }, required: ["token", "color"], }, },
  • Zod schema definition for color strings, used as a reference for color format validation in tools.
    const ColorSchema = z.string().describe("Color string (e.g., 'blue', 'rgb:255,0,0', 'hue:120 saturation:1.0')");

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