channels_listVideos
Retrieve videos from a YouTube channel by providing the channel ID, enabling content analysis and video discovery.
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/server-utils.ts:221-241 (registration)Registration of the 'channels_listVideos' MCP tool, including input schema (Zod) and handler function that calls ChannelService.listVideosserver.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/services/channel.ts:76-98 (handler)Core handler implementation in ChannelService.listVideos method, which performs YouTube API search.list call to retrieve videos from the channel./** * Get channel 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/types.ts:58-64 (schema)TypeScript interface defining parameters for channel videos listing, matching the tool's input schema./** * Channel videos parameters */ export interface ChannelVideosParams { channelId: string; maxResults?: number; }
- src/server-utils.ts:28-32 (helper)Instantiation of ChannelService used by the tool handler.const channelService = new ChannelService(); // Register static resource for Smithery discovery server.registerResource( 'info',
- src/server-utils.ts:57-57 (registration)Tool name listed in the static info resource for discovery."channels_listVideos",