generate_lyrics
Create song lyrics for any theme or genre. Provide a prompt to generate customized lyrics for music 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 that implements the core logic for the 'generate_lyrics' tool. It validates the prompt input, makes a GET request to the MusicGPT API's /lyrics_generator endpoint, and returns the generated lyrics as a formatted JSON response.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:579-596 (schema)The tool schema definition for 'generate_lyrics', including name, description, and inputSchema used for MCP tool listing (via ListToolsRequestHandler) and input validation.{ 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 switch case registration that maps incoming tool calls for 'generate_lyrics' to the handleGenerateLyrics handler function in the CallToolRequestHandler.case "generate_lyrics": return await this.handleGenerateLyrics(args);