Skip to main content
Glama
aldilaff
by aldilaff

wyze_turn_on_device

Activate a Wyze smart light device by providing its MAC address. This tool enables control of connected lighting through the MCP Wyze Server for smart home automation.

Instructions

Turn on a Wyze light device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_macYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'wyze_turn_on_device' tool, decorated with @mcp.tool() for automatic registration in FastMCP. It authenticates the Wyze client, lists all devices to find the one matching the provided MAC address, determines the device model and type, and calls the wyze-sdk's bulbs.turn_on method if it's a supported light device. Returns status dictionary.
    @mcp.tool()
    def wyze_turn_on_device(device_mac: str) -> Dict[str, str]:
        """Turn on a Wyze light device"""
        try:
            client = get_wyze_client()
            devices = client.devices_list()
            
            for device in devices:
                if device.mac == device_mac:
                    # Get device type - try multiple approaches
                    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
                                   getattr(device, 'model', None) or
                                   (hasattr(device, 'product') and getattr(device.product, 'model', None)) or
                                   'Unknown')
                    
                    if device_type in ['Light', 'Bulb', 'MeshLight', 'LightStrip']:
                        client.bulbs.turn_on(device_mac=device_mac, device_model=device_model)
                    else:
                        return {"status": "error", "message": f"Device type '{device_type}' is not a supported light device"}
                    
                    return {"status": "success", "message": f"Device {device.nickname} turned on"}
            
            return {"status": "error", "message": f"Device 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)}"}
  • Helper function used by the wyze_turn_on_device handler (and other tools) to obtain or create the singleton Wyze SDK client instance, loading credentials from environment variables.
    def get_wyze_client() -> Client:
        """Get or create Wyze client instance with auto-login if credentials available"""
        global _wyze_client
        
        if _wyze_client is None:
            # Get credentials from environment
            email = os.getenv("WYZE_EMAIL")
            password = os.getenv("WYZE_PASSWORD")
            key_id = os.getenv("WYZE_KEY_ID")
            api_key = os.getenv("WYZE_API_KEY")
            
            if not all([email, password, key_id, api_key]):
                raise WyzeClientConfigurationError(
                    "Missing required environment variables: WYZE_EMAIL, WYZE_PASSWORD, WYZE_KEY_ID, WYZE_API_KEY"
                )
            
            _wyze_client = Client(
                email=email,
                password=password,
                key_id=key_id,
                api_key=api_key
            )
        
        return _wyze_client
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. It states the action ('Turn on') but lacks details on permissions required, rate limits, error handling, or what the output schema might contain. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero waste. It's front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

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 simplicity (one parameter) and the presence of an output schema (which handles return values), the description is minimally complete. However, as a mutation tool with no annotations and low parameter coverage, it should provide more context on behavior and usage to be fully adequate.

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

Parameters2/5

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

The schema description coverage is 0%, so the description must compensate for the undocumented parameter 'device_mac'. However, it adds no information about the parameter's meaning, format (e.g., MAC address structure), or how to obtain it. This leaves the parameter semantics unclear.

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 ('Turn on') and resource ('a Wyze light device'), making the purpose specific and understandable. It distinguishes from sibling tools like 'wyze_turn_off_device' by specifying the opposite action, though it doesn't explicitly differentiate from other light-related tools like 'wyze_set_brightness'.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing device MAC or being logged in), exclusions (e.g., not for non-light devices), or comparisons to siblings like 'wyze_set_light_effect' for more complex controls.

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