validate_playlist
Checks a proposed playlist against hard constraints and reports every violation with track IDs and an adjust_by amount to correct.
Instructions
Check a proposed playlist against hard constraints and report every violation.
Call this before presenting any playlist to the user. Do not judge for yourself whether a playlist meets its constraints. Each violation names the offending track ids and an adjust_by amount in the constraint's own unit: negative means remove that much, positive means add that much. Act on adjust_by rather than guessing how much to change.
When describing the playlist, quote track_count and total_duration_display from this result verbatim. Never sum durations yourself and never convert milliseconds to minutes yourself.
A duration violation also carries adjust_by_display, the same amount written in minutes and seconds. Show the user that, never the millisecond figure.
Pass the same release-year bounds you gave check_feasibility, so a track outside the window is caught here too.
If the user asks for an energy level or a mood, pass target_energy between 0 and 1. It is scored, never enforced: soft_scores reports how close the playlist came, and because energy is estimated rather than measured, any answer that mentions it must say so.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| track_ids | Yes | ||
| target_energy | No | ||
| released_after | No | ||
| released_before | No | ||
| required_genres | No | ||
| max_total_duration_ms | No | ||
| max_track_duration_ms | No | ||
| max_tracks_per_artist | No | ||
| min_total_duration_ms | No |