Skip to main content
Glama

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
NameRequiredDescriptionDefault
channel_urlYesYouTube channel URL (e.g. https://www.youtube.com/@ChannelName)
limitNoMax shorts to return (default 15)

Implementation Reference

  • 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)}`);
        }
      }
    );
  • 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);
    }

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/ronantakizawa/social-video-mcp'

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