Skip to main content
Glama
Ukenn2112

Bangumi TV MCP Service

by Ukenn2112

get_daily_broadcast

Retrieve the daily broadcast schedule for the current week from Bangumi TV. The schedule is grouped by day, providing a clear overview of anime and show timings.

Instructions

Get the daily broadcast schedule for the current week on Bangumi.

Returns:
    The broadcast schedule grouped by day of the week, or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:328-376 (handler)
    The handler function decorated with @mcp.tool() registers and implements the get_daily_broadcast tool. It fetches the Bangumi /calendar API, processes the response grouping by weekday, formats using format_subject_summary, and returns a string schedule or error.
    @mcp.tool()
    async def get_daily_broadcast() -> str:
        """
        Get the daily broadcast schedule for the current week on Bangumi.
    
        Returns:
            The broadcast schedule grouped by day of the week, or an error message.
        """
        response = await make_bangumi_request(method="GET", path="/calendar")
    
        error_msg = handle_api_error_response(response)
        if error_msg:
            return error_msg
    
        # Expecting a list of dictionaries, where each dict represents a day
        if not isinstance(response, list):
            return f"Unexpected API response format for /calendar: {response}"
    
        calendar_data = response
        if not calendar_data:
            return "Could not retrieve daily broadcast calendar."
    
        formatted_schedule = ["Daily Broadcast Schedule:"]
    
        # The API returns days in a specific order, we can just iterate through the list
        for day_entry in calendar_data:
            weekday = day_entry.get("weekday", {})
            items = day_entry.get("items", [])
    
            # Get readable weekday name, default to English if others are missing
            weekday_name = (
                weekday.get("cn")
                or weekday.get("ja")
                or weekday.get("en")
                or f"Weekday ID {weekday.get('id', 'N/A')}"
            )
            formatted_schedule.append(f"\n--- {weekday_name} ---")
    
            if not items:
                formatted_schedule.append("  No broadcasts scheduled.")
            else:
                formatted_results = [format_subject_summary(s) for s in items]
                results_text = (
                    f"Found {len(items)} subjects.\n"
                    + "---\n".join(formatted_results)
                )
                formatted_schedule.append(results_text)
    
        return "\n".join(formatted_schedule)

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/Ukenn2112/BangumiMCP'

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