transcribe_audio
Convert speech from audio files to text using automated transcription. Specify audio URL and optional language for accurate text output.
Instructions
Transcribe speech from audio to text
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to transcribe | |
| language | No | Language code (e.g., 'en', 'es', 'fr') | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:1209-1228 (handler)Executes the transcribe_audio tool by validating inputs, making a POST request to the MusicGPT API's /audiotranscribe endpoint, and returning the task response with instructions for status checking.private async handleTranscribeAudio(args: any) { if (!args.audio_url) { throw new McpError(ErrorCode.InvalidParams, "audio_url is required"); } const response = await this.axiosInstance.post("/audiotranscribe", { audio_url: args.audio_url, language: args.language, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Audio transcription started!\n\n${JSON.stringify(response.data, null, 2)}\n\nUse get_conversion_by_id with the task_id to check the status.`, }, ], }; }
- src/index.ts:521-542 (registration)Defines and registers the transcribe_audio tool in the TOOLS array, including name, description, and input schema. This array is returned by the listTools request handler.{ name: "transcribe_audio", description: "Transcribe speech from audio to text", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to transcribe", }, language: { type: "string", description: "Language code (e.g., 'en', 'es', 'fr')", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url"], }, },
- src/index.ts:713-714 (helper)Switch case dispatcher that routes calls to the transcribe_audio tool to its handler function.case "transcribe_audio": return await this.handleTranscribeAudio(args);