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), }, ], }; }

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