Skip to main content
Glama
icyrainz

XMLTV MCP Server

by icyrainz

get_programme_details

Retrieve detailed TV programme information by specifying channel ID and start time in XMLTV format for viewing schedules and programme data.

Instructions

Get detailed information about a specific programme

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesChannel ID
start_timeYesProgramme start time in XMLTV format (YYYYMMDDHHMMSS +0000)

Implementation Reference

  • The handler function that fetches XMLTV data, locates the specific programme by channel ID and start time, and returns detailed information including channel, title, subtitle, description, times, episode number, rating, date, icon, and image.
    async function getProgrammeDetails(channelId: string, startTime: string) {
      const data = await getXmltvData();
    
      const programme = data.tv.programme.find(
        prog => prog.channel === channelId && prog.start === startTime
      );
    
      if (!programme) {
        throw new Error("Programme not found");
      }
    
      const channel = data.tv.channel.find(ch => ch.id === channelId);
    
      return {
        channel: {
          id: channelId,
          name: channel?.["display-name"] || channelId,
        },
        title: programme.title,
        subtitle: programme["sub-title"],
        description: programme.desc,
        start: programme.start,
        stop: programme.stop,
        episodeNum: programme["episode-num"],
        rating: programme.rating,
        date: programme.date,
        icon: programme.icon,
        image: programme.image,
      };
    }
  • Input schema definition for the get_programme_details tool, specifying channel_id and start_time as required string parameters with descriptions.
    inputSchema: {
      type: "object",
      properties: {
        channel_id: {
          type: "string",
          description: "Channel ID",
        },
        start_time: {
          type: "string",
          description: "Programme start time in XMLTV format (YYYYMMDDHHMMSS +0000)",
        },
      },
      required: ["channel_id", "start_time"],
    },
  • src/index.ts:312-329 (registration)
    Tool registration object including name, description, and input schema, added to the tools array for listToolsRequest.
    {
      name: "get_programme_details",
      description: "Get detailed information about a specific programme",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: {
            type: "string",
            description: "Channel ID",
          },
          start_time: {
            type: "string",
            description: "Programme start time in XMLTV format (YYYYMMDDHHMMSS +0000)",
          },
        },
        required: ["channel_id", "start_time"],
      },
    },
  • src/index.ts:392-406 (registration)
    Dispatch case in the CallToolRequestSchema handler that extracts arguments, calls the getProgrammeDetails handler, and returns the JSON stringified result.
    case "get_programme_details": {
      const { channel_id, start_time } = request.params.arguments as {
        channel_id: string;
        start_time: string;
      };
      const details = await getProgrammeDetails(channel_id, start_time);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(details, null, 2),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), implying it's likely safe and non-destructive, but doesn't cover aspects like rate limits, error handling, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given the tool has no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, the return format, or any behavioral traits like pagination or errors. For a tool with 2 required parameters and no structured output, more context is needed to be fully helpful.

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

Parameters3/5

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

The input schema has 100% description coverage, with clear documentation for both parameters (channel_id and start_time). The description adds no additional meaning beyond the schema, such as explaining how these parameters uniquely identify a programme or providing usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('detailed information about a specific programme'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'search_programmes' or 'get_schedule', which might also retrieve programme information, so it lacks sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, such as how it differs from 'search_programmes' or 'get_schedule', leaving the agent without usage direction.

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