inpaint_audio
Fill missing or corrupted audio sections using AI by specifying start and end times to restore damaged recordings or remove unwanted segments.
Instructions
Fill in missing or corrupted parts of audio using AI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file with gaps to fill | |
| start_time | Yes | Start time of the section to inpaint in seconds | |
| end_time | Yes | End time of the section to inpaint in seconds | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:1161-1181 (handler)Handler function that validates input parameters, makes a POST request to the MusicGPT API /inpaint endpoint with audio_url, start_time, end_time, and optional webhook_url, and returns a response message with task details.private async handleInpaintAudio(args: any) { if (!args.audio_url || args.start_time === undefined || args.end_time === undefined) { throw new McpError(ErrorCode.InvalidParams, "audio_url, start_time, and end_time are required"); } const response = await this.axiosInstance.post("/inpaint", { audio_url: args.audio_url, start_time: args.start_time, end_time: args.end_time, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Audio inpainting 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:467-492 (schema)Tool definition including name, description, and input schema for validation (requires audio_url, start_time, end_time; optional webhook_url). This object is part of the TOOLS array served in listTools.{ name: "inpaint_audio", description: "Fill in missing or corrupted parts of audio using AI", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file with gaps to fill", }, start_time: { type: "number", description: "Start time of the section to inpaint in seconds", }, end_time: { type: "number", description: "End time of the section to inpaint in seconds", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "start_time", "end_time"], }, },
- src/index.ts:707-708 (registration)Dispatch case in the tool execution switch statement that routes calls to the 'inpaint_audio' tool to its handler function.case "inpaint_audio": return await this.handleInpaintAudio(args);