Skip to main content
Glama
aldilaff
by aldilaff

wyze_set_color

Change the color of Wyze smart lights using hex codes to customize lighting for different moods, tasks, or automation scenarios.

Instructions

Set RGB color for a Wyze light (hex format like 'ff0000' for red)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_macYes
colorYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'wyze_set_color' tool. Decorated with @mcp.tool() which registers the tool. Validates hex color input, finds the device by MAC, and calls the Wyze API to set the color on compatible light devices.
    @mcp.tool()
    def wyze_set_color(device_mac: str, color: str) -> Dict[str, str]:
        """Set RGB color for a Wyze light (hex format like 'ff0000' for red)"""
        try:
            # Validate hex color format
            if not color.startswith('#'):
                color = '#' + color
            if len(color) != 7 or not all(c in '0123456789abcdefABCDEF' for c in color[1:]):
                return {"status": "error", "message": "Color must be in hex format (e.g., 'ff0000' or '#ff0000')"}
            
            client = get_wyze_client()
            devices = client.devices_list()
            
            for device in devices:
                if device.mac == device_mac:
                    # Get device type from multiple possible attributes
                    device_type = (getattr(device, 'product_type', None) or 
                                  getattr(device, 'type', None) or
                                  (hasattr(device, 'product') and getattr(device.product, 'type', None)) or
                                  'Unknown')
                    
                    device_model = (getattr(device, 'product_model', None) or
                                   (hasattr(device, 'product') and getattr(device.product, 'model', None)) or
                                   'Unknown')
                    
                    if device_type in ['Light', 'Bulb', 'MeshLight', 'LightStrip']:
                        client.bulbs.set_color(
                            device_mac=device_mac,
                            device_model=device_model,
                            color=color
                        )
                        return {"status": "success", "message": f"Set {device.nickname} color to {color}"}
            
            return {"status": "error", "message": f"Light with MAC {device_mac} not found"}
        except WyzeClientConfigurationError as e:
            return {"status": "error", "message": f"Configuration error: {str(e)}"}
        except WyzeRequestError as e:
            return {"status": "error", "message": f"API error: {str(e)}"}
        except Exception as e:
            return {"status": "error", "message": f"Unexpected error: {str(e)}"}
  • The @mcp.tool() decorator registers the wyze_set_color function as an MCP tool, with type hints serving as the input schema.
    @mcp.tool()
    def wyze_set_color(device_mac: str, color: str) -> Dict[str, str]:
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this requires authentication (implied by wyze_login sibling), rate limits, error conditions, or what happens if the device is off. For a mutation tool, this is a significant gap.

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 a single, efficient sentence that front-loads the key information (action and format) with zero waste. It's appropriately sized for a simple tool.

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

Completeness3/5

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

Given the tool's complexity (mutation with 2 params, no annotations, but has output schema), the description is minimally adequate. It covers the basic action and color format but lacks usage guidelines, behavioral context, and device_mac details, leaving gaps for an AI agent.

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

Parameters4/5

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

The description adds meaning beyond the schema by specifying that 'color' is in hex format (e.g., 'ff0000' for red), which clarifies the expected input. With 0% schema description coverage and 2 parameters, this compensates well, though it doesn't explain 'device_mac'.

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

Purpose4/5

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

The description clearly states the action ('Set RGB color') and the resource ('for a Wyze light'), making the purpose specific and understandable. It distinguishes from siblings like wyze_set_brightness or wyze_set_color_temp by focusing on RGB color, though it doesn't explicitly name alternatives.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives such as wyze_set_color_temp or wyze_set_light_effect. The description lacks context about prerequisites (e.g., device must be on) or exclusions, leaving usage unclear.

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/aldilaff/mcp-wyze-server'

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