Skip to main content
Glama

tautulli_platform_stats

Retrieve statistics on top platforms and devices by play count and total watch time from your Tautulli server.

Instructions

Get top platforms/devices by plays and total watch time.

Args: days: Time range in days (default 30).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo

Implementation Reference

  • The handler function that executes the `tautulli_platform_stats` tool logic by querying the Tautulli API and formatting the response.
    async def tautulli_platform_stats(days: int = 30) -> str:
        """Get top platforms/devices by plays and total watch time.
    
        Args:
            days: Time range in days (default 30).
        """
        days = _clamp_days(days)
        data = await _api("get_home_stats", time_range=str(days), stat_id="top_platforms")
        rows = data.get("rows", [])
    
        if not rows:
            return f"No platform data for the last {days} days."
    
        lines = [f"Top platforms (last {days} days):\n"]
        for i, r in enumerate(rows[:10], 1):
            platform = r.get("platform", "Unknown")
            plays = r.get("total_plays", 0)
            duration = _fmt_duration(r.get("total_duration", 0))
            lines.append(f"  {i}. {platform} — {plays} plays, {duration} watched")
    
        total_plays = sum(r.get("total_plays", 0) for r in rows)
        total_dur = sum(r.get("total_duration", 0) for r in rows)
        lines.append(f"\nTotal: {total_plays} plays, {_fmt_duration(total_dur)} watched across {len(rows)} platforms")
    
        return "\n".join(lines)

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/lodordev/mcp-tautulli'

If you have feedback or need assistance with the MCP directory API, please join our Discord server