cut_audio
Trim audio files to specific durations by defining start and end times in seconds. Process audio from URLs and receive completion notifications via webhook callbacks.
Instructions
Cut or trim audio to a specific duration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio_url | Yes | URL of the audio file to cut | |
| start_time | Yes | Start time in seconds | |
| end_time | Yes | End time in seconds | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:1056-1076 (handler)The handler function that implements the core logic for the 'cut_audio' tool. It validates inputs, makes a POST request to the '/audio_cutter' API endpoint, and returns a status message with task details.private async handleCutAudio(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("/audio_cutter", { 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 cutting 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:358-381 (schema)The input schema and metadata definition for the 'cut_audio' tool, used for validation and tool listing.name: "cut_audio", description: "Cut or trim audio to a specific duration", inputSchema: { type: "object" as const, properties: { audio_url: { type: "string", description: "URL of the audio file to cut", }, start_time: { type: "number", description: "Start time in seconds", }, end_time: { type: "number", description: "End time in seconds", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["audio_url", "start_time", "end_time"], },
- src/index.ts:697-698 (registration)The dispatch case in the MCP tool execution handler that registers and routes calls to the 'cut_audio' handler function.case "cut_audio": return await this.handleCutAudio(args);