Skip to main content
Glama

tautulli_plays_by_date

Analyze daily media playback trends by stream type (direct play, direct stream, transcode) to monitor Plex server performance and usage patterns over time.

Instructions

Get daily play counts over time, broken down by stream type (direct play, direct stream, transcode).

Args: days: Number of days to show (default 14, max 90).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo

Implementation Reference

  • The handler function tautulli_plays_by_date which fetches daily play counts from Tautulli API and formats the result.
    @mcp.tool()
    async def tautulli_plays_by_date(days: int = 14) -> str:
        """Get daily play counts over time, broken down by stream type (direct play, direct stream, transcode).
    
        Args:
            days: Number of days to show (default 14, max 90).
        """
        days = _clamp_days(days, default=14, maximum=90)
        data = await _api("get_plays_by_stream_type", time_range=str(days))
        rows = _chart_totals(data)
    
        if not rows:
            return f"No play data for the last {days} days."
    
        # Filter out zero-activity days from the start
        first_active = 0
        for i, r in enumerate(rows):
            if r["total"] > 0:
                first_active = i
                break
        rows = rows[first_active:]
    
        if not rows:
            return f"No play activity in the last {days} days."
    
        lines = [f"Daily plays (last {len(rows)} active days):\n"]
        for r in rows:
            dp = r.get("Direct Play", 0)
            ds = r.get("Direct Stream", 0)
            tc = r.get("Transcode", 0)
            total = r["total"]
            bar = "█" * min(total, 50)  # Simple visual bar, capped
            lines.append(f"  {r['name']}: {total:3d} {bar}  (DP:{dp} DS:{ds} TC:{tc})")

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