cut_audio
Trim audio files to specific durations by specifying start and end times. This tool processes audio from URLs and can notify via webhook upon completion.
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)Executes the cut_audio tool: validates parameters, sends POST to /audio_cutter API endpoint, returns task details and status check instructions.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:357-382 (schema)Defines the tool specification for 'cut_audio' including name, description, and input schema used for validation and 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)Registers the dispatch for 'cut_audio' tool calls in the main CallToolRequestSchema switch statement, routing to the handler.case "cut_audio": return await this.handleCutAudio(args);