Skip to main content
Glama
icyrainz

XMLTV MCP Server

by icyrainz

get_now_playing

Retrieve currently airing TV programmes across all channels from XMLTV feeds to monitor live broadcasts and check what's on now.

Instructions

Get currently playing programmes on all channels

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The getNowPlaying function implements the core logic to retrieve currently playing programmes across all channels by parsing XMLTV data and checking the current time against programme start and stop times.
    async function getNowPlaying() {
      const data = await getXmltvData();
      const now = new Date();
    
      const nowPlaying = data.tv.channel.map(channel => {
        const currentProgramme = data.tv.programme.find(prog => {
          if (prog.channel !== channel.id) return false;
          const start = parseXmltvDate(prog.start);
          const stop = parseXmltvDate(prog.stop);
          return now >= start && now < stop;
        });
    
        return {
          channel: {
            id: channel.id,
            name: channel["display-name"],
          },
          programme: currentProgramme ? {
            title: currentProgramme.title,
            subtitle: currentProgramme["sub-title"],
            description: currentProgramme.desc,
            start: currentProgramme.start,
            stop: currentProgramme.stop,
            episodeNum: Array.isArray(currentProgramme["episode-num"])
              ? currentProgramme["episode-num"][0]
              : currentProgramme["episode-num"],
          } : null,
        };
      });
    
      return nowPlaying;
    }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    {
      name: "get_now_playing",
      description: "Get currently playing programmes on all channels",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:351-361 (registration)
    MCP server request handler switch case that registers and invokes the get_now_playing tool by calling the getNowPlaying function and returning JSON-formatted results.
    case "get_now_playing": {
      const nowPlaying = await getNowPlaying();
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(nowPlaying, null, 2),
          },
        ],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, returns real-time vs cached data, or what format the response takes. The description is minimal and lacks important behavioral context for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for a zero-parameter tool and front-loads the essential information. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no output schema, the description provides basic purpose but lacks important context. It doesn't explain what 'currently playing' means temporally (real-time? within what window?), what data is returned, or how this differs from schedule-based siblings. The minimal description is adequate but has clear gaps given the tool's function.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and the schema already fully documents this. No additional parameter information is needed or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'currently playing programmes on all channels', making the purpose immediately understandable. It doesn't specifically differentiate from siblings like 'get_schedule' or 'search_programmes', but the scope ('currently playing' vs scheduled/future programs) provides some implicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided about when to use this tool versus alternatives like 'get_schedule' or 'search_programmes'. The description implies it's for real-time/current programming only, but doesn't state this as explicit usage criteria or mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/icyrainz/xmltv-mcp'

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