Skip to main content
Glama

get_youtube_feed

Fetch videos from your YouTube account's subscriptions, liked videos, watch later list, or viewing history using authenticated browser cookies.

Instructions

Fetch videos from your YouTube account using Chrome cookies. Supports: subscriptions, liked, watch_later, history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
feedYesWhich feed to fetch
limitNoMax number of videos to return (default 15)

Implementation Reference

  • The tool registration and handler logic for 'get_youtube_feed'. It validates input parameters, calls 'fetchFeed', and processes the result using 'pickVideoFields'.
    server.tool(
      'get_youtube_feed',
      'Fetch videos from your YouTube account using Chrome cookies. Supports: subscriptions, liked, watch_later, history.',
      {
        feed: z.enum(['subscriptions', 'liked', 'watch_later', 'history']).describe('Which feed to fetch'),
        limit: z.number().min(1).max(50).default(15).describe('Max number of videos to return (default 15)'),
      },
      async ({ feed, limit }) => {
        const depErr = checkDeps();
        if (depErr) return errorResult(depErr);
    
        try {
          const result = await fetchFeed(FEED_URLS[feed], limit);
          const videos = (result.entries || []).map(pickVideoFields);
          return textResult({ feed, count: videos.length, videos });
        } catch (err) {
          return errorResult(`Error fetching ${feed}: ${err instanceof Error ? err.message : String(err)}`);
        }
      }
    );
  • The core logic that fetches the YouTube feed data by spawning 'yt-dlp' with appropriate arguments.
    export function fetchFeed(url: string, limit: number, start = 1): Promise<YtFeedResult> {
      const args = [
        url, '-J', '--flat-playlist',
        '--playlist-start', String(start),
        '--playlist-end', String(start + limit - 1),
        '--cookies-from-browser', getBrowser(),
      ];
    
      // YouTube-specific extractor arg
      if (url.includes('youtube.com') || url.includes('youtu.be')) {
        args.push('--extractor-args', 'youtubetab:approximate_date');
      }
    
      return spawnYtDlp(args).then((out) => JSON.parse(out));
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries the full burden and successfully discloses the critical authentication mechanism ('using Chrome cookies'). However, it omits other behavioral traits: return format (video metadata structure), side effects (whether a browser window opens), error conditions, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely efficient: two sentences convey purpose, authentication method, and supported feed types. Every element earns its place—the 'Chrome cookies' detail is critical for agent context, and the colon-delimited list efficiently maps to the feed parameter enum.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a 2-parameter tool with complete input schema coverage. However, given the absence of an output schema and annotations, the description should ideally describe the return structure (e.g., list of videos with titles/URLs) or error scenarios to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the schema fully documents both parameters. The description reinforces the 'feed' enum values by listing them (subscriptions, liked, watch_later, history), providing helpful confirmation, but doesn't add syntax details or usage examples beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'Fetch videos from your YouTube account' with specific feed types (subscriptions, liked, watch_later, history). The phrase 'your YouTube account' effectively distinguishes this from sibling tools like get_channel_videos or search_youtube that handle public content, though it doesn't explicitly name those alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'your YouTube account' and listing personal feed types, suggesting this is for authenticated/personal data retrieval. However, it lacks explicit when-to-use guidance or named alternatives (e.g., 'use search_youtube for public queries instead').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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