Skip to main content
Glama

get_channel_videos

Retrieve recent video uploads from any YouTube channel by providing the channel URL, with configurable limits for efficient content discovery.

Instructions

List recent video uploads from a specific YouTube channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_urlYesYouTube channel URL (e.g. https://www.youtube.com/@ChannelName)
limitNoMax videos to return (default 15)

Implementation Reference

  • The handler function that executes the 'get_channel_videos' tool, fetching videos from the provided channel URL.
    async ({ channel_url, limit }) => {
      const urlErr = validateYouTubeUrl(channel_url);
      if (urlErr) return errorResult(urlErr);
      const depErr = checkDeps();
      if (depErr) return errorResult(depErr);
    
      const url = channel_url.endsWith('/videos') ? channel_url : `${channel_url.replace(/\/$/, '')}/videos`;
      try {
        const result = await fetchFeed(url, limit);
        const videos = (result.entries || []).map(pickVideoFields);
        return textResult({ channel: result.title || channel_url, count: videos.length, videos });
      } catch (err) {
        return errorResult(`Error: ${err instanceof Error ? err.message : String(err)}`);
      }
    }
  • src/index.ts:265-287 (registration)
    Registration of the 'get_channel_videos' tool with its input schema definition.
    server.tool(
      'get_channel_videos',
      'List recent video uploads 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 videos 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);
    
        const url = channel_url.endsWith('/videos') ? channel_url : `${channel_url.replace(/\/$/, '')}/videos`;
        try {
          const result = await fetchFeed(url, limit);
          const videos = (result.entries || []).map(pickVideoFields);
          return textResult({ channel: result.title || channel_url, count: videos.length, videos });
        } catch (err) {
          return errorResult(`Error: ${err instanceof Error ? err.message : String(err)}`);
        }
      }
    );

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