Skip to main content
Glama

mcp-youtube

by kirbah
phase1-candidate-search.ts1.21 kB
import { FindConsistentOutlierChannelsOptions } from "../../types/analyzer.types.js"; import { YoutubeService } from "../../services/youtube.service.js"; import { calculateChannelAgePublishedAfter, isQuotaError, } from "./analysis.logic.js"; export async function executeInitialCandidateSearch( options: FindConsistentOutlierChannelsOptions, youtubeService: YoutubeService ): Promise<string[]> { try { const publishedAfter = calculateChannelAgePublishedAfter( options.channelAge ); const searchResults = await youtubeService.searchVideos({ query: options.query, publishedAfter: publishedAfter, type: "video", order: "relevance", maxResults: 50, regionCode: options.regionCode, videoCategoryId: options.videoCategoryId, }); const channelIds = new Set<string>(); for (const video of searchResults) { if (video.snippet?.channelId) { channelIds.add(video.snippet.channelId); } } return Array.from(channelIds); } catch (error: any) { if (isQuotaError(error)) { throw new Error("YouTube API quota exceeded during Phase 1."); } throw new Error(`Phase 1 failed: ${error.message}`); } }

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/kirbah/mcp-youtube'

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