generate_sound_effect
Create custom sound effects from text descriptions using AI audio generation. Specify duration and receive audio files for multimedia projects.
Instructions
Generate sound effects from a text description
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Description of the sound effect to generate | |
| duration | No | Duration of the sound effect in seconds | |
| webhook_url | No | URL for callback upon completion |
Implementation Reference
- src/index.ts:875-894 (handler)The handler function that executes the generate_sound_effect tool. It validates the prompt, sends a POST request to the /soundgenerator endpoint with prompt, optional duration and webhook_url, and returns a status message with task details.private async handleGenerateSoundEffect(args: any) { if (!args.prompt) { throw new McpError(ErrorCode.InvalidParams, "prompt is required"); } const response = await this.axiosInstance.post("/soundgenerator", { prompt: args.prompt, duration: args.duration, webhook_url: args.webhook_url, }); return { content: [ { type: "text", text: `Sound effect generation 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:646-649 (registration)The request handler for listing tools, which returns the TOOLS array containing the generate_sound_effect tool definition.ListToolsRequestSchema, async () => ({ tools: TOOLS, })
- src/index.ts:184-204 (schema)The tool definition in the TOOLS constant, including name, description, and input schema specifying required 'prompt' and optional 'duration' and 'webhook_url'.name: "generate_sound_effect", description: "Generate sound effects from a text description", inputSchema: { type: "object" as const, properties: { prompt: { type: "string", description: "Description of the sound effect to generate", }, duration: { type: "number", description: "Duration of the sound effect in seconds", }, webhook_url: { type: "string", description: "URL for callback upon completion", }, }, required: ["prompt"], }, },
- src/index.ts:673-674 (registration)The switch case in the CallToolRequestSchema handler that routes calls to generate_sound_effect to its handler function.case "generate_sound_effect": return await this.handleGenerateSoundEffect(args);