Skip to main content
Glama
jedarden

YouTube Transcript DL MCP Server

by jedarden

format_transcript

Convert YouTube transcript data into text, JSON, or SRT formats for accessibility and integration needs.

Instructions

Format existing transcript data into different formats

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transcriptYesTranscript data to format
formatYesOutput formatjson

Implementation Reference

  • MCP tool handler that validates input parameters and delegates formatting to the YouTubeTranscriptService.
    private async handleFormatTranscript(args: any) { const { transcript, format } = args; if (!transcript || !format) { throw new McpError(ErrorCode.InvalidParams, 'transcript and format are required'); } const result = this.transcriptService.formatTranscript(transcript, format); return { content: [{ type: 'text', text: result }] }; }
  • Core implementation of the transcript formatting logic, supporting 'text', 'json', and 'srt' output formats.
    public formatTranscript( transcript: TranscriptItem[], format: 'text' | 'json' | 'srt' ): string { switch (format) { case 'text': return transcript.map(item => item.text).join(' '); case 'json': return JSON.stringify(transcript, null, 2); case 'srt': return transcript.map((item, index) => { const start = this.secondsToSrtTime(item.start); const end = this.secondsToSrtTime(item.start + item.duration); return `${index + 1}\n${start} --> ${end}\n${item.text}\n`; }).join('\n'); default: return JSON.stringify(transcript, null, 2); } }
  • Registration of the 'format_transcript' tool in the MCP server, including description and input schema.
    { name: 'format_transcript', description: 'Format existing transcript data into different formats', inputSchema: { type: 'object', properties: { transcript: { type: 'array', items: { type: 'object', properties: { text: { type: 'string' }, start: { type: 'number' }, duration: { type: 'number' } } }, description: 'Transcript data to format' }, format: { type: 'string', enum: ['text', 'json', 'srt'], description: 'Output format', default: 'json' } }, required: ['transcript', 'format'] } },
  • Input schema defining the parameters for the format_transcript tool: transcript array and format enum.
    type: 'object', properties: { transcript: { type: 'array', items: { type: 'object', properties: { text: { type: 'string' }, start: { type: 'number' }, duration: { type: 'number' } } }, description: 'Transcript data to format' }, format: { type: 'string', enum: ['text', 'json', 'srt'], description: 'Output format', default: 'json' } }, required: ['transcript', 'format'] }

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