audio_to_midi
Convert audio files to MIDI format for music production and editing. This tool processes audio URLs to create editable MIDI data.
Instructions
Convert audio to MIDI format
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to convert to MIDI | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:1250-1268 (handler)The handler function for the 'audio_to_midi' tool. Validates the 'audio_url' parameter, sends a POST request to the '/audio_to_midi' backend endpoint with optional webhook_url, and returns a formatted response containing the task details and instructions to check status using another tool.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.`, }, ], }; }
- src/index.ts:561-578 (schema)The schema definition for the 'audio_to_midi' tool in the TOOLS array, specifying name, description, and inputSchema with required 'audio_url' and optional 'webhook_url'.{ 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:717-718 (registration)The switch case in the tool execution handler that routes calls to 'audio_to_midi' to the specific handleAudioToMidi method.case "audio_to_midi": return await this.handleAudioToMidi(args);