wyze_get_scale_info
Retrieve detailed information about a Wyze scale by providing its MAC address. Supports real-time status monitoring and integration with the MCP Wyze Server for smart home device management.
Instructions
Get detailed information about a specific Wyze scale
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_mac | Yes |
Implementation Reference
- src/mcp_wyze_server/server.py:266-304 (handler)The handler function for the 'wyze_get_scale_info' tool, decorated with @mcp.tool() for registration. It fetches detailed scale information using Wyze SDK's client.scales.info(), extracts basic info and family members, handles errors.@mcp.tool() def wyze_get_scale_info(device_mac: str) -> Dict[str, Any]: """Get detailed information about a specific Wyze scale""" try: client = get_wyze_client() scale = client.scales.info(device_mac=device_mac) if scale is None: return {"status": "error", "message": f"Scale with MAC {device_mac} not found"} scale_info = { "mac": str(scale.mac) if scale.mac else "Unknown", "nickname": str(scale.nickname) if scale.nickname else "Unknown", "product_model": str(getattr(scale, 'product_model', 'Unknown')) if getattr(scale, 'product_model', 'Unknown') else "Unknown", "product_type": str(getattr(scale, 'product_type', 'Scale')) if getattr(scale, 'product_type', 'Scale') else "Scale", "is_online": bool(getattr(scale, 'is_online', True)), "firmware_ver": str(getattr(scale, 'firmware_ver', 'N/A')), } # Add family members if available if hasattr(scale, 'family_members') and scale.family_members: family_members = [] for member in scale.family_members: member_info = { "id": str(member.get("id", "Unknown")), "nickname": str(member.get("nickname", "Unknown")), "height": float(member.get("height")) if member.get("height") is not None else None, "goal_weight": float(member.get("goal_weight")) if member.get("goal_weight") is not None else None, } family_members.append(member_info) scale_info["family_members"] = family_members return {"status": "success", "scale": scale_info} 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)}"}
- src/mcp_wyze_server/server.py:266-266 (registration)The @mcp.tool() decorator registers the wyze_get_scale_info function as an MCP tool, with input schema inferred from the function signature (device_mac: str).@mcp.tool()