Skip to main content
Glama

convert_audio_format

Convert audio files between formats like MP3, WAV, FLAC, OGG, and M4A for compatibility with different devices and applications.

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

  • The handler function that implements the core logic for the 'convert_audio_format' tool. It validates inputs, makes an API call to '/fileconvert' endpoint of MusicGPT API, and returns the task details with instructions for status checking.
    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.`,
          },
        ],
      };
    }
  • The tool definition in the TOOLS array, including name, description, and detailed inputSchema with properties and requirements for the 'convert_audio_format' tool.
    {
      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)
    The switch case in the CallToolRequestSchema handler that registers and routes calls to the 'convert_audio_format' tool to its handler method.
    case "convert_audio_format":
      return await this.handleConvertAudioFormat(args);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the conversion action but doesn't disclose traits like processing time, file size limits, authentication needs, rate limits, or whether it's destructive (likely not, but unspecified). The mention of 'webhook_url' in the schema hints at asynchronous processing, but the description doesn't explain this behavior.

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 with zero wasted words. It's front-loaded with the core purpose ('Convert audio file to a different format'), making it immediately understandable. No structural issues or redundancy are present.

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 for a tool with 3 parameters and potential complexity (e.g., asynchronous processing via webhook). It lacks details on behavioral traits, error handling, or output expectations, leaving significant gaps for an AI agent to infer usage correctly.

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%, providing clear documentation for all parameters. The description adds no additional semantic context beyond the schema's details (e.g., it doesn't explain format compatibility or webhook usage). With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to heavily.

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 verb 'convert' and resource 'audio file', specifying the action of format transformation. It distinguishes from siblings like 'change_audio_speed' or 'transcribe_audio' by focusing on format conversion rather than processing or transcription. However, it doesn't explicitly differentiate from all siblings (e.g., 'extract_audio' might also involve format changes).

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 prerequisites (e.g., file accessibility), exclusions (e.g., unsupported formats), or comparisons to siblings like 'audio_to_midi' (which converts to MIDI format) or 'extract_audio' (which might extract audio from video). Usage context is implied but not stated.

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

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