romm_stats
Retrieve library statistics including platform counts, ROM totals, save files, and storage usage for game collection management.
Instructions
Get library statistics — platform count, ROM count, saves, total size.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:335-352 (handler)The `romm_stats` function is decorated with `@mcp.tool()` and implements the logic to fetch and format statistics from the RomM API's `/stats` endpoint.
async def romm_stats() -> str: """Get library statistics — platform count, ROM count, saves, total size.""" data = await _get("stats") if not isinstance(data, dict): return "No stats available." lines = ["RomM Library Statistics:\n"] lines.append(f" Platforms: {data.get('PLATFORMS', 0)}") lines.append(f" ROMs: {data.get('ROMS', 0)}") lines.append(f" Saves: {data.get('SAVES', 0)}") lines.append(f" Save states: {data.get('STATES', 0)}") lines.append(f" Screenshots: {data.get('SCREENSHOTS', 0)}") total = data.get("TOTAL_FILESIZE_BYTES", 0) if total: lines.append(f" Total size: {_fmt_size(total)}") return "\n".join(lines)