Skip to main content
Glama

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
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to cut
start_timeYesStart time in seconds
end_timeYesEnd time in seconds
webhook_urlNoURL for callback upon completion

Implementation Reference

  • 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.`, }, ], }; }
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pasie15/mcp-server-musicgpt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server