Skip to main content
Glama

audio_to_midi

Convert audio files to MIDI format for music production and analysis. Process audio URLs to generate MIDI data for editing and composition.

Instructions

Convert audio to MIDI format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to convert to MIDI
webhook_urlNoURL for callback upon completion

Implementation Reference

  • The handler function that implements the core logic for the 'audio_to_midi' tool. It validates input, makes an HTTP POST request to the external '/audio_to_midi' API endpoint with audio_url and optional webhook_url, and returns a response message with task details.
    private async handleAudioToMidi(args: any) {
      if (!args.audio_url) {
        throw new McpError(ErrorCode.InvalidParams, "audio_url is required");
      }
    
      const response = await this.axiosInstance.post("/audio_to_midi", {
        audio_url: args.audio_url,
        webhook_url: args.webhook_url,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Audio to MIDI 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 input schema definition for the 'audio_to_midi' tool in the TOOLS array, specifying required 'audio_url' and optional 'webhook_url' parameters.
      name: "audio_to_midi",
      description: "Convert audio to MIDI format",
      inputSchema: {
        type: "object" as const,
        properties: {
          audio_url: {
            type: "string",
            description: "URL of the audio file to convert to MIDI",
          },
          webhook_url: {
            type: "string",
            description: "URL for callback upon completion",
          },
        },
        required: ["audio_url"],
      },
    },
  • src/index.ts:715-720 (registration)
    The switch case in the tool execution handler that registers and dispatches calls to 'audio_to_midi' by invoking handleAudioToMidi.
    case "extract_key_bpm":
      return await this.handleExtractKeyBpm(args);
    case "audio_to_midi":
      return await this.handleAudioToMidi(args);
    case "generate_lyrics":
      return await this.handleGenerateLyrics(args);
  • src/index.ts:645-649 (registration)
    Registration of all tools (including 'audio_to_midi') for the ListTools request handler, which returns the TOOLS array containing the tool definition.
    this.server.setRequestHandler(
      ListToolsRequestSchema,
      async () => ({
        tools: TOOLS,
      })
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 conversion action but doesn't describe key traits like whether it's a synchronous or asynchronous process (implied by the webhook_url parameter), potential rate limits, error conditions, or output details. This leaves significant gaps for a tool that likely involves processing time and callback mechanisms.

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 waste. It's front-loaded with the core purpose, making it easy to parse quickly. Every word earns its place, achieving optimal conciseness for such a straightforward tool.

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 the complexity of audio-to-MIDI conversion, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like processing time, output format details, or error handling, which are crucial for an agent to use this tool effectively in a workflow.

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 already documents both parameters (audio_url and webhook_url) clearly. The description adds no additional meaning beyond the schema, such as explaining the conversion process or format specifics. Baseline 3 is appropriate when the schema does the heavy lifting.

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 with a specific verb ('convert') and resource ('audio to MIDI format'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'convert_audio_format' or 'transcribe_audio', which could also involve audio format changes or processing, so it doesn't reach the highest score.

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 any specific scenarios, prerequisites, or exclusions, such as when to choose this over other audio conversion tools in the sibling list, leaving the agent to infer usage from context alone.

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