get_wakeup_rate
Fetch excessive CPU wakeup rate data from Android Vitals to identify apps with frequent CPU wakeups that may trigger platform penalties.
Instructions
Fetch excessive CPU wakeup rate from Android Vitals.
Returns daily excessiveWakeupRate and distinctUsers by version code. Frequent CPU wakeups above platform thresholds may be penalized.
Args: package_name: Package name, e.g. com.example.myapp days: Past days to include (default 7, max 30). version_code: Optional version code filter.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package_name | Yes | ||
| days | No | ||
| version_code | No |
Implementation Reference
- src/google_play_mcp/server.py:749-794 (handler)The tool implementation for get_wakeup_rate, which calls the underlying ReportingClient to query for wakeup rate metrics and formats the response.
def get_wakeup_rate( package_name: str, days: int = 7, version_code: str = "", ) -> str: """Fetch excessive CPU wakeup rate from Android Vitals. Returns daily excessiveWakeupRate and distinctUsers by version code. Frequent CPU wakeups above platform thresholds may be penalized. Args: package_name: Package name, e.g. com.example.myapp days: Past days to include (default 7, max 30). version_code: Optional version code filter. """ days = max(1, min(days, 30)) try: raw = _reporting().query_wakeup_rate( package_name=package_name, days=days, version_code=version_code or None, ) rows = _parse_reporting_rows(raw.get("rows", [])) if not rows: return json.dumps( { "packageName": package_name, "message": ( "No excessive wakeup data available. Data may lag up to 2 days " "or the app has no wakeup violations in this period." ), "rows": [], }, indent=2, ) return json.dumps( { "packageName": package_name, "periodDays": days, "totalRows": len(rows), "rows": rows, }, indent=2, ) except Exception as exc: return json.dumps({"success": False, "error": str(exc)}, indent=2)