generate_music
Generates music clips or full songs from text prompts and optional images, with control over tempo, lyrics, vocal style, and duration.
Instructions
Generate music using Lyria models. Supports lyria-3-clip-preview fixed 30-second clips and lyria-3-pro-preview full songs up to 184 seconds. Lyria 3 supports one clip per prompt; language directions follow the model-card set: English, German, Spanish, French, Hindi, Japanese, Korean, Portuguese. Gemini API/AI Studio mode supports 44.1 kHz stereo audio/mp3 output, and audio/wav only for lyria-3-pro-preview. Negative prompting is not supported. Lyria 3 accepts text prompts and optional imagePaths (PNG (.png), JPEG (.jpg/.jpeg), WEBP (.webp), HEIC (.heic), HEIF (.heif)); audio/video reference files are not accepted. Audio is saved to /root/Music/gemini-generated/music and returned as MCP audio content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | No | Optional tempo direction in beats per minute | |
| model | No | Music model (default: lyria-3-clip-preview) | |
| lyrics | No | Optional user-provided lyrics to include in the Lyria prompt | |
| prompt | Yes | Music generation prompt | |
| language | No | Optional output language direction. Supported Lyria 3 languages: English, German, Spanish, French, Hindi, Japanese, Korean, Portuguese | |
| intensity | No | Optional musical intensity direction | |
| imagePaths | No | Optional local image paths to use as multimodal music generation inputs (max 10). Supported Gemini image input file types: PNG (.png), JPEG (.jpg/.jpeg), WEBP (.webp), HEIC (.heic), HEIF (.heif). Audio/video reference files are not accepted by Lyria 3. | |
| vocalStyle | No | Optional vocal generation direction, such as vocal tone, language, or delivery style | |
| instrumental | No | Explicitly request instrumental-only output | |
| outputMimeType | No | Optional output MIME type; Gemini API/AI Studio defaults to audio/mp3 and supports audio/wav only with lyria-3-pro-preview | |
| durationSeconds | No | Optional target duration in seconds; requires lyria-3-pro-preview; maximum 184 seconds. lyria-3-clip-preview is fixed at 30 seconds |