inpaint_audio
Fill missing or corrupted audio sections using AI by specifying start and end times to restore damaged recordings.
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)The handler function for the 'inpaint_audio' tool. Validates required parameters (audio_url, start_time, end_time), sends a POST request to the '/inpaint' API endpoint with axios, and returns a text content response with the task status and instructions to check progress.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)The tool schema definition in the TOOLS array, including name, description, and inputSchema specifying properties and required fields for input validation.{ 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)The switch case in the CallToolRequestHandler that routes execution to the handleInpaintAudio method.case "inpaint_audio": return await this.handleInpaintAudio(args);
- src/index.ts:644-650 (registration)The ListTools request handler that returns the TOOLS array, which includes the 'inpaint_audio' tool definition.// Handle tool listing this.server.setRequestHandler( ListToolsRequestSchema, async () => ({ tools: TOOLS, }) );