generate_lyrics
Create song lyrics from themes or prompts with genre customization for music composition and creative writing projects.
Instructions
Generate song lyrics based on a theme or prompt
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Theme or prompt for lyrics generation | |
| genre | No | Music genre for the lyrics |
Implementation Reference
- src/index.ts:1270-1290 (handler)The handler function for 'generate_lyrics' tool. Validates input prompt, makes a GET request to the /lyrics_generator API endpoint with prompt and optional genre parameters, and returns the API response as formatted text content.private async handleGenerateLyrics(args: any) { if (!args.prompt) { throw new McpError(ErrorCode.InvalidParams, "prompt is required"); } const response = await this.axiosInstance.get("/lyrics_generator", { params: { prompt: args.prompt, genre: args.genre, }, }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:580-596 (schema)The input schema definition for the 'generate_lyrics' tool, defining required 'prompt' and optional 'genre' parameters. This is part of the TOOLS array used for tool listing.name: "generate_lyrics", description: "Generate song lyrics based on a theme or prompt", inputSchema: { type: "object" as const, properties: { prompt: { type: "string", description: "Theme or prompt for lyrics generation", }, genre: { type: "string", description: "Music genre for the lyrics", }, }, required: ["prompt"], }, },
- src/index.ts:719-720 (registration)The dispatch case in the CallToolRequestSchema handler that routes execution of 'generate_lyrics' to the handleGenerateLyrics method.case "generate_lyrics": return await this.handleGenerateLyrics(args);