generate_playlist
Create a Spotify playlist from a natural-language prompt. Interprets your request, generates a tracklist, and adds matching tracks to a new playlist.
Instructions
Generate and populate a Spotify playlist from a natural-language prompt.
Uses Claude to interpret the prompt and produce a tracklist, then creates a new playlist and searches for each track on Spotify.
Parameters
prompt : str
Natural-language description, e.g. "10 summer hits from 2024".
playlist_name : str, optional
Name for the new playlist. If omitted, Claude will suggest one.
Returns
dict
Keys: playlist_id, playlist_name, playlist_url,
tracks_added (int), tracks_not_found (list[str]).
Raises
EnvironmentError
If GEMINI_API_KEY is not configured.
ValueError
If prompt is blank.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| playlist_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||