Skip to main content
Glama

tautulli_plays_by_date

Track daily play counts by stream type (direct play, direct stream, transcode) to analyze media server 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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for tautulli_plays_by_date which fetches data from the Tautulli API and formats it into a summary string.
    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})")
    
        total_all = sum(r["total"] for r in rows)
        avg = total_all / len(rows) if rows else 0

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