get_channel_shorts
Retrieve recent YouTube Shorts from a specific channel URL to monitor short-form video content. Specify a limit to control the number of videos returned.
Instructions
List recent Shorts from a specific YouTube channel.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_url | Yes | YouTube channel URL (e.g. https://www.youtube.com/@ChannelName) | |
| limit | No | Max shorts to return (default 15) |
Implementation Reference
- src/index.ts:322-342 (handler)The tool registration and handler implementation for get_channel_shorts. It validates the URL, checks dependencies, and calls fetchShortsFromChannel to retrieve the data.
server.tool( 'get_channel_shorts', 'List recent Shorts from a specific YouTube channel.', { channel_url: z.string().url().describe('YouTube channel URL (e.g. https://www.youtube.com/@ChannelName)'), limit: z.number().min(1).max(50).default(15).describe('Max shorts to return (default 15)'), }, async ({ channel_url, limit }) => { const urlErr = validateYouTubeUrl(channel_url); if (urlErr) return errorResult(urlErr); const depErr = checkDeps(); if (depErr) return errorResult(depErr); try { const shorts = await fetchShortsFromChannel(channel_url, limit); return textResult({ channel: channel_url, count: shorts.length, shorts }); } catch (err) { return errorResult(`Error: ${err instanceof Error ? err.message : String(err)}`); } } ); - src/index.ts:291-295 (helper)The fetchShortsFromChannel helper function used by the get_channel_shorts tool to perform the actual data fetching.
async function fetchShortsFromChannel(channelUrl: string, limit: number) { const url = `${stripChannelSuffix(channelUrl)}/shorts`; const result = await fetchFeed(url, limit); return (result.entries || []).map(pickVideoFields); }