Skip to main content
Glama

Transcribe Audio URL (sync)

transcribe_audio_url_sync

Transcribe audio or video from a URL by submitting the link and waiting for results (up to 5 minutes). Supports multiple formats and optional language selection.

Instructions

Submit a URL for transcription and poll until completion (up to 5 minutes). Prefer transcribe_audio_url for faster handoff when clients can poll.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesPublic URL of audio/video file (mp3, m4a, wav, mp4, webm, etc.) Max 200 MB.
languageNoISO 639-1 code, e.g. "en", "es". Auto-detected if omitted.

Implementation Reference

  • The tool 'transcribe_audio_url_sync' is registered via server.registerTool(). Also contains the handler function inline (the async callback at line 58).
    export function register(server: McpServer, client: GhostMinutesClient): void {
      server.registerTool(
        'transcribe_audio_url_sync',
        {
          title: 'Transcribe Audio URL (sync)',
          description:
            'Submit a URL for transcription and poll until completion (up to 5 minutes). Prefer transcribe_audio_url for faster handoff when clients can poll.',
          inputSchema: z.object({
            url: z
              .string()
              .url()
              .describe(
                'Public URL of audio/video file (mp3, m4a, wav, mp4, webm, etc.) Max 200 MB.',
              ),
            language: z
              .string()
              .length(2)
              .optional()
              .describe(
                'ISO 639-1 code, e.g. "en", "es". Auto-detected if omitted.',
              ),
          }),
          annotations: { readOnlyHint: false, openWorldHint: true },
        },
        async ({ url, language }) => {
          const submitted = await client.submitTranscription(url, language);
          const jobId = submitted.id;
          const deadline = Date.now() + 5 * 60 * 1000;
    
          while (Date.now() < deadline) {
            const statusBody = await client.getJobStatus(jobId);
            const t = terminalState(statusBody);
            if (t === 'done') {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Transcription finished for job_id ${jobId}.`,
                  },
                ],
                structuredContent: jsonStructured(statusBody),
              };
            }
            if (t === 'failed') {
              throw new Error(
                `Transcription failed for job_id ${jobId}: ${JSON.stringify(statusBody)}`,
              );
            }
            await sleep(2000);
          }
    
          throw new Error(
            `Timed out after 5 minutes waiting for job_id ${jobId}. Use get_transcription_status to poll.`,
          );
        },
      );
    }
  • The async handler that submits a URL for transcription, polls up to 5 minutes for completion, returns result on success or throws on failure/timeout.
    async ({ url, language }) => {
      const submitted = await client.submitTranscription(url, language);
      const jobId = submitted.id;
      const deadline = Date.now() + 5 * 60 * 1000;
    
      while (Date.now() < deadline) {
        const statusBody = await client.getJobStatus(jobId);
        const t = terminalState(statusBody);
        if (t === 'done') {
          return {
            content: [
              {
                type: 'text',
                text: `Transcription finished for job_id ${jobId}.`,
              },
            ],
            structuredContent: jsonStructured(statusBody),
          };
        }
        if (t === 'failed') {
          throw new Error(
            `Transcription failed for job_id ${jobId}: ${JSON.stringify(statusBody)}`,
          );
        }
        await sleep(2000);
      }
    
      throw new Error(
        `Timed out after 5 minutes waiting for job_id ${jobId}. Use get_transcription_status to poll.`,
      );
    },
  • Input schema defined with Zod: requires 'url' (string.url) and optional 'language' (2-letter ISO code). Also sets title, description, and annotations.
    'transcribe_audio_url_sync',
    {
      title: 'Transcribe Audio URL (sync)',
      description:
        'Submit a URL for transcription and poll until completion (up to 5 minutes). Prefer transcribe_audio_url for faster handoff when clients can poll.',
      inputSchema: z.object({
        url: z
          .string()
          .url()
          .describe(
            'Public URL of audio/video file (mp3, m4a, wav, mp4, webm, etc.) Max 200 MB.',
          ),
        language: z
          .string()
          .length(2)
          .optional()
          .describe(
            'ISO 639-1 code, e.g. "en", "es". Auto-detected if omitted.',
          ),
      }),
      annotations: { readOnlyHint: false, openWorldHint: true },
    },
  • src/server.ts:10-10 (registration)
    The register function from src/tools/transcribe-url-sync.ts is imported and called at line 33 to register the tool on the McpServer.
    import { register as registerTranscribeSync } from './tools/transcribe-url-sync.js';
  • GhostMinutesClient methods used by the handler: submitTranscription() posts the URL to /mcp/transcribe, and getJobStatus() polls /mcp/status/{jobId}.
    async submitTranscription(
      audioUrl: string,
      language?: string,
    ): Promise<{ id: string; [key: string]: unknown }> {
      try {
        const res = await this.http.post<
          unknown,
          AxiosResponse<{ id: string; [key: string]: unknown }>
        >(
          '/mcp/transcribe',
          {
            audio_file_url: audioUrl,
            ...(language ? { language } : {}),
          },
          {
            headers: this.hasApiKey()
              ? { Authorization: `Bearer ${this.apiKey}` }
              : {},
          },
        );
        return this.ensureOk(res);
      } catch (e) {
        this.handleThrown(e);
      }
    }
    
    async getJobStatus(jobId: string): Promise<unknown> {
      try {
        const res = await this.http.get(`/mcp/status/${encodeURIComponent(jobId)}`, {
          headers: this.hasApiKey()
            ? { Authorization: `Bearer ${this.apiKey}` }
            : {},
        });
        return this.ensureOk(res);
      } catch (e) {
        this.handleThrown(e);
      }
    }
Behavior4/5

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

Discloses polling behavior and timeout up to 5 minutes, adding value beyond annotations (readOnlyHint=false, openWorldHint=true). No contradiction; description is consistent and informative.

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?

Two sentences, front-loaded with action and time limit, no wasted words. Efficient and clear structure.

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

Completeness4/5

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

Tool description is complete for a synchronous transcription poll, but lacks mention of return format or error handling. Adequate given no output schema.

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 covers 100% of parameters with descriptions for 'url' and 'language'. Description does not add extra parameter details beyond schema, so baseline 3 is appropriate.

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

Purpose5/5

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

Description clearly states 'Submit a URL for transcription and poll until completion', giving a specific verb+resource. It distinguishes from sibling transcribe_audio_url by noting the synchronous nature.

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

Usage Guidelines5/5

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

Explicit advice to prefer transcribe_audio_url for faster handoff when clients can poll, and mentions polling up to 5 minutes, providing clear context for when to use this versus the alternative.

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

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/Rocketech-Software-Development/ghostminutes-mcp'

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