Skip to main content
Glama
lenvolk
by lenvolk

breathe_effect

Create a breathing light effect on LIFX smart bulbs by cycling colors with adjustable duration, cycles, and brightness for dynamic ambiance.

Instructions

Perform a breathe effect

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesLIFX API token
selectorNoSelector for filtering lights (default: 'all')
colorYesColor to breathe
from_colorNoStarting color
periodNoDuration of one cycle in seconds
cyclesNoNumber of cycles
persistNoPersist the final color
power_onNoTurn on if off
peakNoPeak brightness (0.0 to 1.0)

Implementation Reference

  • Handler function for 'breathe_effect' tool that constructs the request body from parameters and calls the LIFX API to start the breathe effect.
    case "breathe_effect": {
      const { token, selector = "all", ...effectParams } = args as {
        token: string;
        selector?: string;
        color: string;
        from_color?: string;
        period?: number;
        cycles?: number;
        persist?: boolean;
        power_on?: boolean;
        peak?: number;
      };
    
      const body = Object.fromEntries(
        Object.entries(effectParams).filter(([_, value]) => value !== undefined)
      );
    
      const result = await makeLIFXRequest(`/lights/${selector}/effects/breathe`, {
        method: "POST",
        body,
        token,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Breathe effect started for selector "${selector}". ${JSON.stringify(result, null, 2)}`,
          },
        ],
      };
    }
  • Tool definition including name, description, and JSON input schema for validation.
    {
      name: "breathe_effect",
      description: "Perform a breathe effect",
      inputSchema: {
        type: "object",
        properties: {
          token: { type: "string", description: "LIFX API token" },
          selector: { type: "string", description: "Selector for filtering lights (default: 'all')" },
          color: { type: "string", description: "Color to breathe" },
          from_color: { type: "string", description: "Starting color" },
          period: { type: "number", minimum: 0.1, description: "Duration of one cycle in seconds" },
          cycles: { type: "number", minimum: 1, description: "Number of cycles" },
          persist: { type: "boolean", description: "Persist the final color" },
          power_on: { type: "boolean", description: "Turn on if off" },
          peak: { type: "number", minimum: 0, maximum: 1, description: "Peak brightness (0.0 to 1.0)" },
        },
        required: ["token", "color"],
      },
  • Helper function used by the handler to make authenticated HTTP requests to the LIFX API.
    async function makeLIFXRequest(
      endpoint: string,
      options: {
        method?: string;
        body?: any;
        token: string;
      }
    ): Promise<any> {
      const { method = "GET", body, token } = options;
      
      const url = `${LIFX_API_BASE}${endpoint}`;
      const headers: Record<string, string> = {
        "Authorization": `Bearer ${token}`,
        "User-Agent": USER_AGENT,
      };
    
      if (body && (method === "POST" || method === "PUT")) {
        headers["Content-Type"] = "application/json";
      }
    
      try {
        const response = await fetch(url, {
          method,
          headers,
          body: body ? JSON.stringify(body) : undefined,
        });
    
        if (!response.ok) {
          const errorText = await response.text();
          throw new Error(`LIFX API error: ${response.status} ${response.statusText} - ${errorText}`);
        }
    
        // Some endpoints return empty responses
        const contentType = response.headers.get("content-type");
        if (contentType?.includes("application/json")) {
          return await response.json();
        }
        
        return await response.text();
      } catch (error) {
        throw new Error(`Failed to make LIFX API request: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. 'Perform a breathe effect' implies a mutating action on lights, but it does not detail side effects (e.g., whether it overrides other effects, requires authentication via token, or has rate limits). The description fails to compensate for the lack of annotations, leaving key behavioral traits undocumented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with a single sentence, 'Perform a breathe effect', which is front-loaded and wastes no words. While this conciseness comes at the cost of detail, it efficiently communicates the core action without redundancy or unnecessary elaboration, earning a high score for structure and brevity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no annotations, no output schema), the description is inadequate. It does not explain what the tool returns, how errors are handled, or the operational context (e.g., interacting with LIFX lights). The lack of behavioral details and usage guidelines, combined with no output schema, leaves significant gaps for an agent to understand and use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning all parameters are documented in the input schema itself. The description adds no additional meaning about parameters beyond what the schema provides (e.g., it does not explain how 'color' and 'from_color' interact or what 'breathe' entails). Given the high schema coverage, a baseline score of 3 is appropriate, as the description does not enhance parameter understanding but also does not detract from it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Perform a breathe effect' is a tautology that essentially restates the tool name 'breathe_effect' without specifying what the effect does or what resource it acts upon. While it implies an action ('perform'), it lacks specificity about the target (LIFX lights) or the nature of the effect (color breathing animation). This makes it vague and minimally informative compared to more descriptive alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'pulse_effect' (which might be similar) or 'set_state' (for static color changes), nor does it specify prerequisites, contexts, or exclusions for usage. This absence of comparative or contextual information leaves the agent without direction for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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