Skip to main content
Glama

convert_audio_format

Convert audio files between formats like MP3, WAV, FLAC, OGG, and M4A. Specify input URL and desired output format for transformation.

Instructions

Convert audio file to a different format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to convert
output_formatYesDesired output format
webhook_urlNoURL for callback upon completion

Implementation Reference

  • Executes the convert_audio_format tool by validating inputs, POSTing to MusicGPT API /fileconvert endpoint with audio_url, output_format, and optional webhook_url, then returns formatted response with task status polling instructions.
    private async handleConvertAudioFormat(args: any) { if (!args.audio_url || !args.output_format) { throw new McpError(ErrorCode.InvalidParams, "audio_url and output_format are required"); } const response = await this.axiosInstance.post("/fileconvert", { audio_url: args.audio_url, output_format: args.output_format, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Audio format conversion started!\n\n${JSON.stringify(response.data, null, 2)}\n\nUse get_conversion_by_id with the task_id to check the status.`, }, ], }; }
  • Input schema validation for the tool parameters: required audio_url (string), output_format (string enum: mp3/wav/flac/ogg/m4a), optional webhook_url (string).
    inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to convert", }, output_format: { type: "string", description: "Desired output format", enum: ["mp3", "wav", "flac", "ogg", "m4a"], }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "output_format"], },
  • src/index.ts:334-356 (registration)
    Tool registration in the TOOLS array: defines name, description, and input schema. This array is served in response to ListToolsRequestSchema.
    { name: "convert_audio_format", description: "Convert audio file to a different format", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to convert", }, output_format: { type: "string", description: "Desired output format", enum: ["mp3", "wav", "flac", "ogg", "m4a"], }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "output_format"], }, },
  • src/index.ts:695-696 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement, routing tool calls to the handleConvertAudioFormat handler.
    case "convert_audio_format": return await this.handleConvertAudioFormat(args);

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/pasie15/mcp-server-musicgpt'

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