Skip to main content
Glama
efikuta
by efikuta

simplify_video_transcript

Transform YouTube video transcripts into simplified, age-appropriate versions for better understanding, with customizable output formats and optional key term definitions.

Instructions

Create age-appropriate simplified versions of video transcripts (ELI5 mode)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeDefinitionsNoInclude definitions for key terms
outputFormatNoPreferred output formatparagraph
targetAgeNoTarget age for simplification
videoIdYesYouTube video ID to simplify

Implementation Reference

  • Main handler function 'execute' that implements the core logic of the 'simplify_video_transcript' tool. Parses input args using the schema, handles caching, fetches transcript, simplifies content using LLM, computes readability scores, and returns the simplified transcript.
    async execute(args: unknown): Promise<SimplifiedTranscript> { const params = SimplifyVideoTranscriptSchema.parse(args); this.logger.info(`Simplifying transcript for video ${params.videoId} (target age: ${params.targetAge})`); // Generate cache key const cacheKey = `eli5:${params.videoId}:${params.targetAge}:${params.outputFormat}:${params.includeDefinitions}`; // Check cache first const cached = await this.cache.get<SimplifiedTranscript>(cacheKey); if (cached) { this.logger.info(`Returning cached ELI5 transcript for: ${params.videoId}`); return cached; } try { // Step 1: Get video details with transcript const videoDetails = await this.youtubeClient.getVideoDetails({ videoId: params.videoId, includeTranscript: true, includeComments: false }); if (!videoDetails.transcript || videoDetails.transcript.length === 0) { throw new Error(`No transcript available for video ${params.videoId}`); } // Step 2: Process and prepare transcript const processedTranscript = this.transcriptProcessor.processTranscript(videoDetails.transcript); // Step 3: Simplify using LLM const simplifiedContent = await this.simplifyTranscript( processedTranscript.fullText, videoDetails.video, params ); // Step 4: Calculate readability improvement const readabilityScores = this.calculateReadabilityScores( processedTranscript.fullText, simplifiedContent.content.sections.map(s => s.content).join(' ') ); const result: SimplifiedTranscript = { videoId: params.videoId, originalLength: processedTranscript.fullText.length, simplifiedLength: simplifiedContent.content.sections.map(s => s.content).join(' ').length, targetAge: params.targetAge, content: simplifiedContent.content, readabilityScore: readabilityScores }; // Cache the result await this.cache.set(cacheKey, result, 7200); // 2 hours cache this.logger.info(`ELI5 simplification completed for ${params.videoId}. Readability improved by ${readabilityScores.improvement}%`); return result; } catch (error) { this.logger.error(`Failed to simplify transcript for ${params.videoId}:`, error); throw error; } }
  • Zod schema defining input validation for the simplify_video_transcript tool, including videoId, targetAge, outputFormat, and includeDefinitions.
    export const SimplifyVideoTranscriptSchema = z.object({ videoId: z.string().describe('YouTube video ID'), targetAge: z.number().min(5).max(18).default(12).describe('Target age for simplification'), includeDefinitions: z.boolean().default(true).describe('Include definitions for complex terms'), outputFormat: z.enum(['paragraph', 'bullet_points', 'qa']).default('paragraph').describe('Output format'), });
  • src/index.ts:443-473 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and inputSchema for 'simplify_video_transcript'.
    name: 'simplify_video_transcript', description: 'Create age-appropriate simplified versions of video transcripts (ELI5 mode)', inputSchema: { type: 'object', properties: { videoId: { type: 'string', description: 'YouTube video ID to simplify' }, targetAge: { type: 'number', minimum: 5, maximum: 18, default: 12, description: 'Target age for simplification' }, outputFormat: { type: 'string', enum: ['paragraph', 'bullet_points', 'qa'], default: 'paragraph', description: 'Preferred output format' }, includeDefinitions: { type: 'boolean', default: true, description: 'Include definitions for key terms' } }, required: ['videoId'] } },
  • src/index.ts:588-590 (registration)
    Switch case in CallToolRequest handler that dispatches calls to 'simplify_video_transcript' to the ELI5Simplifier instance's execute method.
    case 'simplify_video_transcript': result = await this.eli5Tool.execute(args); break;
  • src/index.ts:180-180 (registration)
    Instantiation of the ELI5Simplifier handler instance used for the simplify_video_transcript tool.
    this.eli5Tool = new ELI5Simplifier(this.youtubeClient, this.cache, this.llmService, this.transcriptProcessor, this.logger);

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

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