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
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | Channel ID | |
| start_time | Yes | Programme start time in XMLTV format (YYYYMMDDHHMMSS +0000) |
Implementation Reference
- src/index.ts:220-249 (handler)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, }; }
- src/index.ts:315-328 (schema)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), }, ], }; }