channels_listVideos
Retrieve videos from a YouTube channel by providing the channel ID, with options to limit results.
Instructions
Get videos from a specific channel
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelId | Yes | The YouTube channel ID | |
| maxResults | No | Maximum number of results to return |
Implementation Reference
- src/services/channel.ts:79-98 (handler)Core handler logic in ChannelService.listVideos method that performs YouTube API search.list call filtered by channelId to retrieve the channel's videos.async listVideos({ channelId, maxResults = 50 }: ChannelVideosParams): Promise<unknown[]> { try { this.initialize(); const response = await this.youtube.search.list({ part: ['snippet'], channelId, maxResults, order: 'date', type: ['video'] }); return response.data.items || []; } catch (error) { throw new Error(`Failed to list channel videos: ${error instanceof Error ? error.message : String(error)}`); } }
- src/server-utils.ts:221-241 (registration)MCP tool registration for 'channels_listVideos', including Zod input schema and thin wrapper handler delegating to ChannelService.server.registerTool( 'channels_listVideos', { title: 'List Channel Videos', description: 'Get videos from a specific channel', annotations: { readOnlyHint: true, idempotentHint: true }, inputSchema: { channelId: z.string().describe('The YouTube channel ID'), maxResults: z.number().optional().describe('Maximum number of results to return'), }, }, async ({ channelId, maxResults }) => { const result = await channelService.listVideos({ channelId, maxResults }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } );
- src/types.ts:61-64 (schema)TypeScript interface defining input parameters for channel videos listing, used by ChannelService.listVideos.export interface ChannelVideosParams { channelId: string; maxResults?: number; }