Skip to main content
Glama
jedarden

YouTube Transcript DL MCP Server

by jedarden

list_transcripts

Retrieve all available transcripts for a YouTube video by specifying its ID or URL, ensuring accurate and accessible content extraction in multiple formats.

Instructions

List all available transcripts for a YouTube video

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
videoIdYesYouTube video ID or URL

Implementation Reference

  • Registration of the 'list_transcripts' MCP tool, including name, description, and input schema definition.
    { name: 'list_transcripts', description: 'List all available transcripts for a YouTube video', inputSchema: { type: 'object', properties: { videoId: { type: 'string', description: 'YouTube video ID or URL' } }, required: ['videoId'] } }
  • MCP server handler for 'list_transcripts' tool call, validates input and delegates to YouTubeTranscriptService.
    private async handleListTranscripts(args: any) { const { videoId } = args; if (!videoId) { throw new McpError(ErrorCode.InvalidParams, 'videoId is required'); } const result = await this.transcriptService.listTranscripts(videoId); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Core handler implementation in YouTubeTranscriptService that executes the Python script to list available transcripts for a video.
    public async listTranscripts(videoId: string): Promise<{ success: boolean; videoId: string; transcripts: Array<{ language: string; language_code: string; is_generated: boolean; is_translatable: boolean; }>; error?: string; }> { try { const cleanVideoId = this.extractVideoId(videoId); const command = `python3 "${this.pythonScript}" list --video-id "${cleanVideoId}"`; const { stdout, stderr } = await execAsync(command); if (stderr) { this.logger.warn(`Python script warning: ${stderr}`); } const result: PythonListResult = JSON.parse(stdout); return result; } catch (error) { this.logger.error(`Failed to list transcripts for video ${videoId}:`, error); return { success: false, videoId: this.extractVideoId(videoId), transcripts: [], error: error instanceof Error ? error.message : 'Unknown error' }; } }
  • Input schema definition for the 'list_transcripts' tool.
    inputSchema: { type: 'object', properties: { videoId: { type: 'string', description: 'YouTube video ID or URL' } }, required: ['videoId'] }

Other Tools

Related 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/jedarden/yt-transcript-dl-mcp'

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