Skip to main content
Glama

wyze_get_scale_records

Retrieve weight measurement records from a Wyze scale by specifying the device MAC, user ID, and desired time range. Access historical data for health tracking purposes.

Instructions

Get weight measurement records from a Wyze scale

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
days_backNo
device_macNo
user_idNo

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the core logic for retrieving scale records using the Wyze SDK. It calculates a time range based on days_back, fetches records via client.scales.get_records(), processes them into a structured list with measurements like weight, BMI, body fat, etc., and handles various errors.
    @mcp.tool() def wyze_get_scale_records( device_mac: str = None, user_id: str = None, days_back: int = 30 ) -> Dict[str, Any]: """Get weight measurement records from a Wyze scale""" try: from datetime import datetime, timedelta client = get_wyze_client() # Calculate time range end_time = datetime.now() start_time = end_time - timedelta(days=days_back) records = client.scales.get_records( user_id=user_id, start_time=start_time, end_time=end_time ) record_list = [] for record in records: record_info = { "measure_time": int(record.measure_ts) if hasattr(record, 'measure_ts') and record.measure_ts else None, "weight": float(record.weight) if hasattr(record, 'weight') and record.weight is not None else None, "bmi": float(record.bmi) if hasattr(record, 'bmi') and record.bmi is not None else None, "body_fat": float(record.body_fat) if hasattr(record, 'body_fat') and record.body_fat is not None else None, "muscle_mass": float(record.muscle) if hasattr(record, 'muscle') and record.muscle is not None else None, "heart_rate": int(record.heart_rate) if hasattr(record, 'heart_rate') and record.heart_rate is not None else None, } record_list.append(record_info) return { "status": "success", "records": record_list, "count": len(record_list), "days_back": days_back } 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)}"}

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