Skip to main content
Glama
MushroomFleet

TranscriptionTools MCP Server

format_transcript

Convert timestamped transcripts into readable text by removing timestamps and organizing content into paragraphs and lines based on specified time gaps.

Instructions

Transforms timestamped transcripts into naturally formatted text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_textYesTimestamped transcript text or path to file
is_file_pathNoWhether input_text is a file path
line_gapNoSeconds gap for line breaks
paragraph_gapNoSeconds gap for paragraph breaks

Implementation Reference

  • Core implementation of the format_transcript tool: parses timestamped lines, extracts times, groups text, and applies formatting rules based on time gaps and grammar for natural reading flow.
    export async function formatTranscript(params: FormatTranscriptParams): Promise<{ formatted_text: string }> {
      try {
        const { 
          input_text, 
          is_file_path = false, 
          paragraph_gap = 8, // default 8 seconds for paragraph breaks
          line_gap = 4 // default 4 seconds for line breaks
        } = params;
        
        // Resolve content (either direct text or from file)
        const textContent = await FileHandler.resolveTextContent(input_text, is_file_path);
        
        // Parse the timestamped transcript
        const lines = textContent.trim().split('\n');
        
        // This will store our processed text segments with their timestamps
        const segments: Array<{ time: number; text: string }> = [];
        
        // Parse each line to extract timestamp and text
        for (const line of lines) {
          // Extract timestamp using regex
          const match = line.match(/\[(\d{2}):(\d{2}):(\d{2})\]\s*(.*)/);
          
          if (match) {
            const hours = parseInt(match[1], 10);
            const minutes = parseInt(match[2], 10);
            const seconds = parseInt(match[3], 10);
            const text = match[4].trim();
            
            // Convert timestamp to seconds
            const timeInSeconds = hours * 3600 + minutes * 60 + seconds;
            
            // Add to segments
            segments.push({ time: timeInSeconds, text });
          } else {
            // Handle lines without timestamps
            if (segments.length > 0) {
              // Append to the previous segment if it exists
              segments[segments.length - 1].text += ' ' + line.trim();
            } else {
              // Create a new segment with time 0 if no previous segment
              segments.push({ time: 0, text: line.trim() });
            }
          }
        }
        
        // Process segments to create naturally formatted text
        let formattedText = '';
        let lastTime = -1;
        
        for (let i = 0; i < segments.length; i++) {
          const segment = segments[i];
          
          // First segment or determine spacing based on time gap
          if (i === 0) {
            formattedText = segment.text;
          } else {
            const timeGap = segment.time - lastTime;
            
            // Rule 1: Paragraph break for gaps > paragraph_gap seconds
            if (timeGap > paragraph_gap) {
              formattedText += '\n\n' + segment.text;
            }
            // Rule 2: Line break for gaps > line_gap seconds
            else if (timeGap > line_gap) {
              formattedText += '\n' + segment.text;
            }
            // Rule 3: Apply natural grammar rules
            else {
              // Check if we should add space or join without space
              const lastChar = formattedText.charAt(formattedText.length - 1);
              const endsWithSentenceMarker = /[.!?]$/.test(formattedText);
              const startsWithLowerCase = /^[a-z]/.test(segment.text);
              
              if (endsWithSentenceMarker) {
                // Start a new sentence
                formattedText += ' ' + segment.text;
              } else if (lastChar === ',' || lastChar === ';' || lastChar === ':') {
                // Continue after punctuation
                formattedText += ' ' + segment.text;
              } else if (startsWithLowerCase) {
                // Likely continuing a thought
                formattedText += ' ' + segment.text;
              } else {
                // Otherwise just add space
                formattedText += ' ' + segment.text;
              }
            }
          }
          
          lastTime = segment.time;
        }
        
        return { formatted_text: formattedText };
      } catch (error) {
        throw new Error(`Formatting process failed: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • TypeScript interface defining the input parameters for the formatTranscript function.
    export interface FormatTranscriptParams {
      input_text: string;
      is_file_path?: boolean;
      paragraph_gap?: number; // seconds
      line_gap?: number; // seconds
    }
  • src/index.ts:88-116 (registration)
    MCP tool registration in listTools handler: defines name, description, and inputSchema for format_transcript.
    {
      name: 'format_transcript',
      description: 'Transforms timestamped transcripts into naturally formatted text',
      inputSchema: {
        type: 'object',
        properties: {
          input_text: {
            type: 'string',
            description: 'Timestamped transcript text or path to file'
          },
          is_file_path: {
            type: 'boolean',
            description: 'Whether input_text is a file path',
            default: false
          },
          paragraph_gap: {
            type: 'number', 
            description: 'Seconds gap for paragraph breaks',
            default: 8
          },
          line_gap: {
            type: 'number',
            description: 'Seconds gap for line breaks',
            default: 4
          }
        },
        required: ['input_text']
      }
    },
  • src/index.ts:185-198 (registration)
    Dispatch logic in callToolRequest handler: validates params and invokes formatTranscript function for format_transcript tool.
    case 'format_transcript':
      // Validate required parameters
      if (!args || typeof args.input_text !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Missing required parameter: input_text');
      }
      const formatResult = await formatTranscript(args as unknown as FormatTranscriptParams);
      return {
        content: [
          {
            type: 'text',
            text: formatResult.formatted_text
          }
        ]
      };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the transformation action but lacks details on permissions, rate limits, output format, or error handling. For a tool with no annotations, this is insufficient to inform the agent about behavioral traits beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain the return values or behavioral aspects like what 'naturally formatted text' entails. For a transformation tool with 4 parameters, more context is needed to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description doesn't add any meaning beyond what the schema provides, such as explaining how 'line_gap' and 'paragraph_gap' affect formatting. With high schema coverage, a baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Transforms timestamped transcripts into naturally formatted text.' It specifies the verb ('transforms') and resource ('timestamped transcripts'), and the outcome ('naturally formatted text'). However, it doesn't differentiate from sibling tools like 'repair_text' or 'summary_text', which might also process text, so it misses full sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'repair_text' or 'summary_text', nor does it specify contexts or exclusions for usage. This leaves the agent without clear direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/MushroomFleet/TranscriptionTools-MCP'

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