commendation
commendation
Un servidor MCP que recomienda canciones nuevas — nunca una canción que ya esté en tu biblioteca, es decir, nunca una canción que ya esté en Liked Music o en cualquiera de tus listas de reproducción, no solo en la que usaste como semilla.
Está diseñado para superar la radio/reproducción automática integrada de un servicio de streaming combinando múltiples señales de descubrimiento independientes (radio, contenido relacionado, expansión del catálogo del artista) y clasificando los candidatos según cuántas de ellas coinciden, en lugar de confiar en un único algoritmo de caja negra.
Backend: YouTube Music (v1). Commendation está diseñado como un motor de recomendación general, no vinculado a un solo servicio — v1 está construido enteramente con YouTube Music (a través de ytmusicapi). El soporte de Spotify está previsto como segundo backend; consulta la sección "v3 — Multi-provider support" de PLAN.md para las cuestiones de diseño al respecto.
Herramientas
Herramienta | Descripción |
| Recomienda canciones nuevas similares a una canción semilla. Pasa |
| Recomienda canciones nuevas basándose en una lista de reproducción completa (toma muestras de canciones semilla de ella). |
| Devuelve canciones reales de un artista con nombre — una extracción directa del catálogo, no una recomendación por similitud. |
Las tres herramientas garantizan que cada resultado no esté en Liked Music ni en ninguna de tus listas de reproducción, no solo en la que usaste como semilla (si la hay). recommend_from_song además nunca devuelve la canción semilla en sí; recommend_from_playlist además nunca devuelve nada de la lista de reproducción semilla, incluso si esa lista no apareciera en tu biblioteca.
songs_by_artist es un tipo de herramienta diferente de las otras dos: sin puntuación, sin señales de radio/relacionados — solo el catálogo real de ese artista, con la misma exclusión de toda tu biblioteca aplicada. Es un requisito estricto, no de mejor esfuerzo: si existen menos de limit canciones que cumplan los requisitos, devuelve las que se hayan encontrado (found en la respuesta) en lugar de rellenar la lista con sustitutos. Nunca añade nada a ninguna parte.
No incluido (v1): comparación basada en BPM/tempo. YouTube Music no expone datos de tempo, así que esto necesita una segunda fuente de datos (p. ej., una API de BPM de terceros) — un objetivo ambicioso para una versión futura, no parte de esta versión. Consulta PLAN.md para conocer la justificación completa del diseño.
Related MCP server: youtube-music-mcp
Configuración
1. Instalar dependencias
python3 -m venv .venv
source .venv/bin/activate
pip install -e .2. Autenticación (YouTube Music)
No hay una API oficial de YouTube Music, por lo que ytmusicapi autentica reutilizando las cabeceras de tu sesión del navegador con la sesión iniciada.
Abre music.youtube.com en Firefox (recomendado — su copia de cabeceras en bruto es más fiable que la de Chrome) con la sesión iniciada.
Abre DevTools (
Cmd+Option+I/F12) → pestaña Red → filtra porbrowse.Haz clic en una lista de reproducción, o recarga la página, para provocar una petición POST
browse.Haz clic en esa petición → pestaña Cabeceras → activa Cabeceras en bruto → selecciona y copia todo el bloque.
Pégalo en un archivo nuevo llamado
raw_headers.txten la raíz del proyecto y guárdalo.Ejecuta:
python scripts/setup_auth_from_file.pyEsto escribe
headers_auth.jsony eliminaraw_headers.txt.
Alternativamente, python scripts/setup_auth.py hace lo mismo mediante un mensaje interactivo en la terminal en lugar de un archivo, si prefieres pegar directamente.
headers_auth.json equivale a tu sesión iniciada — nunca lo confirmes ni lo compartas. Ya está excluido en .gitignore.
Verifica que la autenticación funciona y comprueba las recomendaciones antes de continuar:
python scripts/test_recommend.pyEstas cabeceras caducan/rotan periódicamente. Si las herramientas empiezan a fallar con un error de autenticación, repite este paso.
3. Añadir a Claude Code
claude mcp add commendation -s user \
-e COMMENDATION_AUTH_PATH="$(pwd)/headers_auth.json" \
-- "$(pwd)/.venv/bin/python" "$(pwd)/server.py"-s user hace que esté disponible en cualquier sesión de Claude Code, no solo en este directorio. Usa rutas absolutas para el intérprete de Python, server.py y COMMENDATION_AUTH_PATH, ya que el servidor puede lanzarse desde cualquier directorio de trabajo.
Para otros clientes MCP (Claude Desktop, etc.), apúntalos al mismo comando y variable de entorno usando su formato de configuración respectivo.
Pruebas
Las pruebas unitarias (tests/) cubren la lógica pura — normalización, puntuación, clasificación, filtrado de exclusión, resolución de búsqueda de artista/canción, traducción de errores y las tres herramientas de extremo a extremo (caso feliz, fallos de señal, insuficiencias, errores de validación) — contra un cliente falso de YTMusic hecho a mano. No se requiere acceso a la red ni headers_auth.json.
pip install -e ".[dev]"
pytestComprueba la cobertura con:
pytest --cov=server --cov-report=term-missingserver.py tiene una cobertura de líneas del 98%; las dos líneas que quedan sin cubrir son la construcción real de YTMusic() en _client() y el punto de entrada if __name__ == "__main__", ninguna de las cuales se puede probar de forma significativa sin una sesión de autenticación activa o sin ejecutar realmente el servidor como un proceso.
scripts/test_recommend.py es una prueba de humo complementaria y separada que accede a tu cuenta real (consulta el paso 2 de Configuración) para comprobar que la autenticación y las recomendaciones en vivo funcionan realmente.
Cómo se clasifican las recomendaciones
Para cada canción semilla, los candidatos se obtienen de tres señales independientes:
Radio — la radio/reproducción automática de YouTube Music para esa canción.
Relacionado — una señal separada de "contenido relacionado", algorítmicamente distinta de la radio.
Expansión del artista — las otras canciones del artista semilla, además de las canciones más populares de un par de sus artistas relacionados.
La puntuación de un candidato es la cantidad de combinaciones distintas (semilla, señal) que lo sacaron a la luz — cuantas más señales independientes coincidan, más alto se clasifica. Cada resultado incluye un campo sources que muestra qué señales lo sacaron a la luz, por lo que las recomendaciones son explicables en lugar de una caja negra.
Liked Music y todas las listas de reproducción de tu biblioteca se excluyen al final, siempre, como un filtro estricto — ninguna recomendación puede ser jamás una canción que ya te haya gustado o que ya hayas guardado en cualquier lugar.
Gestión de errores
Las llamadas a las herramientas traducen los modos de fallo comunes en mensajes claros en lugar de tracebacks sin procesar:
Autenticación faltante, caducada o malformada → te dice que vuelvas a ejecutar
scripts/setup_auth_from_file.py.Límite de peticiones (HTTP 429) → te dice que esperes y reintentes.
Contenido restringido o con acceso limitado → se informa como no disponible en lugar de fallar.
Errores de red → se informan directamente.
Si una señal individual (radio, relacionado o expansión del artista) falla para una semilla determinada, esa señal se omite silenciosamente para esa semilla en lugar de hacer fallar toda la recomendación.
Licencia
MIT — consulta LICENSE.
Available Tools
10 toolsexplain_recommendationA
Explain why a song was recommended, in mood terms.
Reports the song's mood vector, which layer produced it (Claude reading the lyrics, YouTube mood-playlist membership, or the artist's own average), the named moods it sits closest to, and the mood it was last served against.
| Name | Required | Description | Default |
|---|---|---|---|
| video_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden, and it does disclose the internal mechanics: the mood vector, which of three source layers produced it, the nearest named moods, and the mood last served against. It stops short of stating error behavior (e.g., what happens if the song was never recommended) or confirming it is side-effect-free.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose in the first clause, followed by one sentence enumerating what is reported. No filler, no repetition of the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only explanatory tool with an output schema present, the description need not restate return formats and is complete enough to call correctly. The only real gap is the undocumented video_id, which is minor given the output schema carries the result contract.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% for the single required video_id, and the description never mentions it, so it adds no meaning beyond the bare property name. The parameter is fairly self-evident, which keeps this from being a 1, but the description does not compensate for the coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Explain why a song was recommended') and scopes it to mood terms. This clearly separates it from the action-oriented siblings like recommend_from_song and recommend_from_playlist, which produce recommendations rather than explain them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied: call this after a recommendation exists to understand its basis. There is no explicit when-to-use, no statement of prerequisites (e.g., must the song have been recommended?), and no routing to alternatives among the ten siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
index_statusA
Report how much of the mood index exists, so gaps are visible not silent.
Covers the mood-playlist crawl, how much of the listener's library carries a mood label and from which layer, and whether Claude-based labelling is configured. Low coverage means recommendations are ranking mostly on signal agreement rather than on mood -- worth saying out loud.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the behavioral burden, and it does reasonably well by disclosing exactly what the report contains and how to interpret low coverage (ranking on signal agreement rather than mood). It never explicitly states the operation is read-only or side-effect-free, which leaves one gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The core purpose is front-loaded in the first sentence and the rest adds diagnostic meaning. A few phrases ('gaps are visible not silent', 'worth saying out loud') are stylistic flourishes that could be trimmed, but the passage stays short.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given an output schema exists and there are no parameters or annotations, the description supplies enough conceptual context to know what the report conveys and why it matters. It stops short of describing invocation conditions, but little else is needed for a no-arg diagnostic.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so per the rubric the baseline is 4. There is no parameter syntax to document and the description introduces none.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ('Report how much of the mood index exists') and enumerates the scope it covers (crawl coverage, labelled library layers, Claude-labelling config). This clearly separates it from all siblings, which are recommendation, retrieval, or mutation tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied: the tool exists to surface index gaps and the description notes the implication of low coverage for recommendations, which hints at when it's worth calling. But there is no explicit 'use this when...' instruction or contrast with alternatives like refresh_library.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_my_moodA
Infer the listener's current mood from recent listening, with evidence.
Returns the inferred vector, a plain-language described, a confidence,
and evidence -- the specific observations behind it (a song on repeat, one
artist dominating, valence drifting across the session).
Lead with the evidence, not the verdict. "You've had these three on loop since yesterday -- want something that sits there with you, or something that lifts?" is the point of this tool; asserting "you are sad" is not. Mood inference is often wrong, so offer it as a read the user can correct.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses the epistemic limits of the tool ('mood inference is often wrong'), instructs that the result be presented as correctable, and names the concrete signals used. It omits anything about latency, caching, or how much history is scanned, but the fallibility disclosure is unusually valuable context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose, then the return shape, then the interaction rule. The quoted example earns its space by encoding tone, though the enumeration of return fields partially duplicates the output schema and could be trimmed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool with a rich output schema and no annotations, this covers purpose, output framing, and the key caveat about unreliable inference. The only real gap is not routing the agent to the mood-recommendation siblings when the user actually wants a suggestion.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so the baseline is 4. There is nothing for the description to disambiguate, and it correctly avoids inventing input semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — infer the listener's current mood from recent listening — and frames it as an evidence-backed read, which cleanly separates it from the recommendation siblings (recommend_for_mood, recommend_from_playlist_for_mood). An agent can tell what this returns without opening the output schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear interaction guidance (lead with evidence, offer the inference as a correctable read) but never says when to call this instead of, or before, recommend_for_mood. The when-to-use case is only implied by the conversational framing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
recommend_for_moodA
Recommend new songs that match how the listener actually feels right now.
Unlike recommend_from_song, the mood decides where candidates come from: seeds are drawn from the listener's OWN library nearest the target mood, then expanded through radio/related/artist signals and songs from YouTube's mood playlists. Results are still guaranteed absent from their library.
Describing the mood -- in priority order:
vector The precise path, and the one to prefer. A dict with
valence (-1..1, despairing->euphoric), energy (0..1,
still->frantic), tension (0..1, resolved->anxious; this is what
separates angry from excited) and depth (0..1, background
->lyric-forward). YOU should read the user's words and set
these -- you understand "wistful but still wants to get things
done" far better than any keyword list.
feeling Their words verbatim, as a fallback when you'd rather not
commit to numbers. Matched against a mood-word lexicon.
context One of: Chill, Sleep, Focus, Commute, Feel good, Romance,
Energize, Workout, Party, Gaming, Sad.
If none are given, the mood is inferred from recent listening history.
arc shapes the sequence rather than returning a flat mood-matched set:
mirror stay where they are and validate it (default)
lift start where they are, rise gradually -- never jump straight to
upbeat when someone is low, it reads as being told to cheer up
settle descend to calm; an evening wind-down
deepen go further in; sometimes you want to sit in it properly
hold stay in a band with energy as a curve (workout: warmup/peak/cooldown)
genres optionally restricts the seeds to the listener's own genre
playlists, e.g. ["Punjabi", "Hip-Hop & Rap"].
language / exclude_languages filter the RESULTS, e.g.
language=["english"]. Strict by default: a candidate with no language label
is dropped, because someone asking for English only wants a guarantee. The
response says how many were dropped and why; pass
allow_unlabelled_language=True to keep them.
bpm biases ranking toward a tempo (half- and double-time count as close).
bpm_min/bpm_max bound it instead. Songs with no known BPM are KEPT and
simply not scored on tempo -- Deezer has no tempo for much of the
non-English catalogue, so dropping them would delete whole languages.
limit is a ceiling, not a guarantee. If fewer than limit songs genuinely
fit the mood (rated, with a real fit -- not just an unrated placeholder
score), the shortfall is NOT padded with weak filler to hit the number.
Filler is capped at 25% of limit: asking for 100 with 7 genuine matches
returns 32 (7 + 25), not 100. See match_quality in the result for the
genuine/filler breakdown, and notes for the human-readable version.
If they also point at a specific playlist ("look at this playlist and recommend me songs for how I feel"), use recommend_from_playlist_for_mood instead -- it seeds from that playlist's own fitting tracks rather than from the whole library.
This is READ-ONLY. If they asked for a PLAYLIST rather than a list, this tool is step one of three: get the songs here, create the playlist from the returned videoIds with a playlist-management tool, then call refresh_library() so those tracks are excluded from later recommendations.
The result carries target (the mood aimed at), target_origin (where it
came from), seeds (which of their songs it grew from), notes (caveats
worth repeating to the user), match_quality (genuine vs. filler counts)
and songs, each with its slot, mood fit and which signals surfaced it.
| Name | Required | Description | Default |
|---|---|---|---|
| arc | No | mirror | |
| bpm | No | ||
| limit | No | ||
| genres | No | ||
| vector | No | ||
| bpm_max | No | ||
| bpm_min | No | ||
| context | No | ||
| feeling | No | ||
| language | No | ||
| exclude_languages | No | ||
| allow_unlabelled_language | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full behavioral burden and it does: declares READ-ONLY, guarantees results absent from library, discloses the strict language filter and the unlabelled-drop behavior, and explains the 25% filler cap with a concrete example (7 + 25 = 32). These are non-obvious traits an agent cannot infer elsewhere.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with purpose and organized under clear parameter headers, so it scans well despite its length. It is verbose and occasionally repetitive (the filler logic is restated in both `limit` and the result description), but nearly every sentence carries operational detail that would otherwise be missing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present the description need not explain return values, yet it still previews `target`, `seeds`, `match_quality`, and `notes` to tell the agent what to surface to the user. Combined with the alternative routing and the playlist hand-off, an agent has everything needed to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% and the schema has no enums, so the description compensates fully: it defines vector's four numeric dimensions with ranges and semantics, enumerates all eleven `context` values, documents each `arc` mode, and explains bpm_min/max biasing, language filtering, allow_unlabelled_language, and limit's ceiling-not-guarantee semantics. All 12 params gain meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('recommend new songs that match how the listener actually feels') and immediately contrasts its seed-selection mechanism against recommend_from_song. An agent can distinguish it from every sibling without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly names when to switch: 'If they also point at a specific playlist ... use recommend_from_playlist_for_mood instead.' It also clarifies the multi-step playlist workflow (get songs here, create playlist, call refresh_library) and that this tool is not for building playlists directly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
recommend_from_playlistA
Recommend new songs based on an entire playlist.
Randomly samples up to seed_sample_size tracks from the playlist as seeds (the whole playlist if it's smaller), runs the same multi-signal candidate generation as recommend_from_song for each, and pools/ranks the results. Never returns a song already in Liked Music, already in the source playlist, or already in ANY other of the user's playlists.
The library exclusion set is cached for speed; newly liked songs are always honoured, but call refresh_library() after adding songs to a playlist by other means.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| playlist_id | Yes | ||
| seed_sample_size | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so well: it discloses the sampling strategy (up to seed_sample_size random seeds), the pooling/ranking approach, and hard output guarantees (never returns songs in Liked Music, the source playlist, or any other playlist). It also flags a caching staleness risk and the refresh_library remedy, which is exactly the kind of behavioral caveat an agent needs before trusting results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the one-line purpose, then layers mechanism, guarantees, and the caching caveat in short paragraphs; every sentence carries information. Slightly verbose in restating the multi-signal pipeline, but no filler sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return-value explanation is unnecessary, and the description covers seeding, exclusions, and cache behavior. The main gap is the unexplained `limit` parameter and no mention of failure modes for an invalid playlist_id, but overall it is sufficient to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for three undocumented parameters. It explains seed_sample_size concretely (random seed count, with whole-playlist fallback) and implies playlist_id's role, but never explains what `limit` (default 20) controls. Partial compensation only.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Names a specific verb and resource ('Recommend new songs based on an entire playlist') and explicitly differentiates its mechanism from the sibling recommend_from_song ('runs the same multi-signal candidate generation as recommend_from_song for each, and pools/ranks'). An agent can distinguish it from recommend_from_song and recommend_from_playlist_for_mood without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear context for when this tool applies (you have a whole playlist rather than one seed song) and an explicit follow-up call ('call refresh_library() after adding songs to a playlist by other means'), which routes the agent to a sibling when the cache is stale. It stops short of an explicit 'use recommend_from_song when you only have one track' exclusion, so it is strong but not fully enumerated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
recommend_from_playlist_for_moodA
Recommend new songs from ONE playlist, shaped by how the listener feels.
For "I feel like this -- look at this playlist and find me songs". Use this over recommend_from_playlist whenever a mood is part of the ask, and over recommend_for_mood whenever a specific playlist is.
Unlike recommend_from_playlist, which samples a few tracks at random and ignores mood entirely: EVERY track in the playlist is read and scored for mood fit, and only genuine matches -- tracks whose own mood resolves and actually fits the target -- are used as seeds. An off-mood playlist therefore yields few seeds or none, which is reported rather than papered over by seeding from tracks that don't fit.
Seeding costs ~4 API calls per seed, so the best-fitting seeds are capped
(default 20, override with seed_cap). seed_report in the result says how
many tracks were considered, how many were genuine, and how many were
capped away.
Mood arguments behave exactly as in recommend_for_mood (vector preferred,
then feeling, then context; falls back to inferred mood). arc shapes
the sequence the same way. Results are guaranteed absent from Liked Music,
from this playlist, and from every other playlist -- and limit is a
ceiling, not a guarantee: filler is capped at 25% of it, same as
recommend_for_mood.
This is READ-ONLY -- it never creates a playlist or adds anything anywhere. To turn the result into a real playlist, pass the returned videoIds to a playlist-management tool, then call refresh_library() so the new tracks are excluded from later recommendations.
| Name | Required | Description | Default |
|---|---|---|---|
| arc | No | mirror | |
| bpm | No | ||
| limit | No | ||
| vector | No | ||
| bpm_max | No | ||
| bpm_min | No | ||
| context | No | ||
| feeling | No | ||
| language | No | ||
| seed_cap | No | ||
| playlist_id | Yes | ||
| exclude_languages | No | ||
| allow_unlabelled_language | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden and does so richly: read-only guarantee, ~4 API calls per seed with a default cap of 20, seed_report contents (considered/genuine/capped), the fact that off-mood playlists legitimately yield few or no seeds rather than being papered over, exclusion guarantees, and the 25% filler ceiling on `limit`. This is exactly the cost/side-effect/auth context an agent needs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the one-line purpose and the routing rule before any internals, and every paragraph adds a distinct fact (contrast, cost/seed behavior, mood args, guarantees, read-only follow-up). It is long, and a couple of clauses ('same as recommend_for_mood') are mild repetition, but no paragraph is filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present it correctly avoids re-describing return values while still flagging the meaningful `seed_report` field. For a 13-parameter, no-annotation, no-schema-description tool it covers behavior thoroughly, but the unaddressed bpm/language parameter family is a real completeness gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate and it only partially does. It clarifies vector>feeling>context precedence, arc's shaping role, seed_cap, and limit's ceiling semantics, but 13 parameters exist and bpm/bpm_min/bpm_max, language, exclude_languages, and allow_unlabelled_language are never addressed beyond their self-evident names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource+scope: 'Recommend new songs from ONE playlist, shaped by how the listener feels.' It explicitly contrasts itself with both closest siblings (recommend_from_playlist and recommend_for_mood) and names the distinguishing dimension (mood presence, playlist specificity).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives explicit routing rules: 'Use this over recommend_from_playlist whenever a mood is part of the ask, and over recommend_for_mood whenever a specific playlist is,' plus a concrete user-facing trigger ('I feel like this -- look at this playlist and find me songs'). It also explains the follow-up workflow (pass videoIds to a playlist tool, then call refresh_library()).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
recommend_from_songA
Recommend new songs similar to a seed song.
Seed the search either with a known video_id, or with song (a free-text
title, optionally narrowed with artist) to have the seed resolved via
search internally -- e.g. "10 songs that relate to Kryptonite by 3 Doors
Down" needs no separate lookup first. Exactly one of video_id or song
must be given.
Combines YouTube Music's radio, its separate "related" signal, and the seed artist's own catalog plus related artists' catalogs, then ranks by how many independent signals agreed on each candidate. Never returns the seed song itself, and never returns a song already in Liked Music or in ANY of the user's playlists.
By default candidates can come from OTHER artists too (radio/related
signals surface stylistically similar tracks, not just the seed artist's
own catalog) -- pass same_artist_only=True to keep only songs credited
to the seed's own artist(s), e.g. for "recommend songs BY artist X similar
to song Y" requests.
language / exclude_languages filter the RESULTS independently of the
seed, which is the point: seeding from a Punjabi song with
language=["english"] returns English songs similar to it. Strict by
default -- candidates with no language label are dropped, since a
Punjabi-seeded pool is mostly Punjabi and keeping unlabelled ones would
hand back exactly what was excluded. Pass allow_unlabelled_language=True
to relax that; the response always reports what was dropped.
When a language filter leaves too few results -- seeding from a Punjabi song and asking for English usually does -- the surviving songs are used as fresh seeds to reach more of that language in the same neighbourhood, since filtering alone can only return what happened to be in the seed's own pool. Set expand_across_language=False to skip that and get the short list.
match_seed_tempo=True biases results toward the seed's own BPM (half-
and double-time count as close). bpm sets a tempo target directly, and
bpm_min/bpm_max bound it. Songs with no known BPM are kept and simply
not scored on tempo.
Returns {"songs": [...], "notes": [...], "filters": {...}} -- notes carry anything the user should hear about, such as results dropped for having no language label.
The library exclusion set is cached for speed; newly liked songs are always honoured, but call refresh_library() after adding songs to a playlist by other means.
| Name | Required | Description | Default |
|---|---|---|---|
| bpm | No | ||
| song | No | ||
| limit | No | ||
| artist | No | ||
| bpm_max | No | ||
| bpm_min | No | ||
| language | No | ||
| video_id | No | ||
| max_per_artist | No | ||
| match_seed_tempo | No | ||
| same_artist_only | No | ||
| exclude_languages | No | ||
| expand_across_language | No | ||
| allow_unlabelled_language | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so: it discloses the multi-signal ranking strategy, that the seed song is never returned, exclusion of Liked Music and all playlists, the default cross-artist behaviour, language-filter strictness with allow_unlabelled_language escape hatch, and the response shape with notes. It even flags a cache-staleness behaviour and the refresh_library() remedy — exactly the kind of non-obvious trait annotations would normally supply.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose and the required-argument rule are front-loaded, and essentially every sentence adds a distinct behavioural fact, so length is largely justified. A few conversational asides ('which is the point:') and repeated restatements of the language-filter rationale could be trimmed without losing information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need not be re-explained, and the description nonetheless names the response keys and the role of `notes`. Combined with the mutual-exclusion rule, filter semantics, and the cache/refresh_library dependency, an agent has everything needed to call this 14-parameter tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 14 parameters, so the description is the only source of meaning, and it explains the semantics of most of them: video_id vs song mutual exclusion, artist narrowing, language/exclude_languages independence from the seed, allow_unlabelled_language, expand_across_language, same_artist_only, and match_seed_tempo/bpm/bpm_min/bpm_max including the half/double-time and missing-BPM cases. It leaves `limit` and `max_per_artist` (the default of 2) undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence gives a specific verb and resource ('Recommend new songs similar to a seed song'), which cleanly separates it from the playlist- and mood-seeded siblings by seeding resource. It never names those siblings explicitly, so an agent must infer the routing from the resource noun rather than being told.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Strong in-scope guidance: exactly one of video_id or song must be given, with a worked example ('10 songs that relate to Kryptonite by 3 Doors Down'); it also explains when same_artist_only, language filters, and expand_across_language apply. It does not, however, compare itself against the sibling tools (recommend_from_playlist, recommend_for_mood), so the agent gets no explicit alternative routing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
record_feedbackB
Record what the listener thought of a recommendation.
reaction is one of: loved, saved, skipped, wrong_mood.
wrong_mood is the valuable one -- it says the song was fine but the mood
read was off, which is a different failure from simply not liking it.
Anything marked skipped or wrong_mood is never recommended again.
| Name | Required | Description | Default |
|---|---|---|---|
| reaction | Yes | ||
| video_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It does disclose a meaningful system effect -- 'Anything marked skipped or wrong_mood is never recommended again' -- which is durable state change worth knowing. However, it omits idempotency, auth/permission needs, error behavior, and whether feedback can be changed after recording.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Short and front-loaded: purpose first, then the allowed values, then the consequence. Every sentence carries weight, though the sentimental framing of 'the valuable one' is mildly editorial rather than operational.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described, and the reaction semantics are covered well. The one gap is the undocumented required `video_id` and no statement of the recording's persistence or reversibility, which leaves the agent guessing on a required field.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It fully enumerates and interprets the `reaction` values, which the schema does not (no enum). But `video_id` is never explained -- the agent must infer where a video id comes from -- leaving half the parameters undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource ('Record what the listener thought of a recommendation'), making it a feedback sink that is easily distinguished from the sibling recommender tools. It does not explicitly name siblings, but the purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Use is implied by the recommender sibling set (call this after a recommendation is consumed), and it hints at the value of one reaction type. There is no explicit when-to-use, when-not, or routing to alternatives such as explain_recommendation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
refresh_libraryA
Rebuild the cached library exclusion set from scratch, right now.
Every recommendation tool excludes songs already in Liked Music or any of your playlists. That set is expensive to build (~20s), so it's cached and reused. Liking a song is picked up immediately regardless, but adding a song to some other playlist is only seen once the cache is rebuilt.
Call this after adding songs to a playlist by other means (e.g. a playlist-management tool) if you want the next recommendation to account for them without waiting out the cache TTL.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so well: it discloses the ~20s build cost, that the result is cached and reused, and that the effect is only otherwise visible after a cache TTL. It also clarifies the incremental freshness rule (likes immediate, playlist adds deferred), which is non-obvious and directly affects whether the agent should call it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The action is front-loaded in the first sentence and each subsequent sentence adds real information (cost, cache semantics, call condition). The cache-economics paragraph is slightly more expansive than strictly needed, but it is not wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described. For a zero-parameter maintenance tool, the description covers the why, the cost, the caching model, and the precise call condition, leaving no material gap for an agent deciding whether to invoke it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, so the baseline is 4 and there is no parameter syntax for the description to clarify. Nothing is missing, but there is also no opportunity to add semantic value here.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Names a specific verb and resource ('Rebuild the cached library exclusion set') and immediately explains its relationship to the sibling recommendation tools, which all consume this set. An agent can distinguish this maintenance tool from recommend_* siblings without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
States the exact trigger ('Call this after adding songs to a playlist by other means') and explicitly contrasts it with the case where it is unnecessary, since liking a song is already picked up immediately. It also names the alternative workflow (a playlist-management tool) that creates the need.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
songs_by_artistA
Return actual songs by a specific artist -- a direct catalog pull, not a similarity recommendation like recommend_from_song/recommend_from_playlist.
Resolves artist (a name) to its YouTube Music channel and pulls its
real song catalog, excluding anything already in Liked Music OR in ANY
of the user's playlists (not just one, unlike recommend_from_playlist's
single-seed-playlist exclusion). Read-only: never adds results anywhere.
This is a hard requirement, not best-effort -- if fewer than limit
qualifying songs exist after exclusion, this returns however many were
actually found rather than padding the list. Check found vs
requested in the result to see whether it fell short.
Remix/feature variants of the same underlying song (e.g. a track and its
"(feat. ...)" credit under a different videoId) count once, not once
per variant -- see variants_collapsed in the result.
The library exclusion set is cached for speed; newly liked songs are always honoured, but call refresh_library() after adding songs to a playlist by other means.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| artist | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses read-only behavior ('never adds results anywhere'), the exclusion set semantics (Liked Music OR any playlist), the hard requirement that it returns fewer than limit rather than padding, and the variant-collapsing behavior. It does not state auth/permission requirements or rate limits, so not a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Multi-paragraph but front-loads the core purpose and sibling differentiation first, then layers in exclusion behavior, shortfall semantics, variant collapsing, and caching. Each paragraph earns its place, though some detail could be trimmed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema, so return-value explanation is largely unnecessary, yet the description references result fields ('found' vs 'requested', 'variants_collapsed') to clarify semantics. Covers exclusion behavior, caching caveat, and refresh_library guidance. Could still note artist-resolution failure behavior, but is largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains 'artist' is a name resolved to a YouTube Music channel and mentions 'limit' as a qualifying-songs count, adding real meaning. But it does not specify limit bounds, defaults effect, or exact artist-matching semantics, leaving gaps for a 0%-coverage schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('Return actual songs by a specific artist -- a direct catalog pull') and explicitly distinguishes itself from siblings by contrasting with similarity recommendations like recommend_from_song/recommend_from_playlist. The direct-catalog-pull framing makes it unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly contrasts this tool with recommend_from_song and recommend_from_playlist, and clarifies the exclusion scope differs from recommend_from_playlist's single-seed-playlist exclusion. It also instructs when to call refresh_library(). Strong when-to-use guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
10 tool updates
v0.2.0- First observed
explain_recommendation - First observed
index_status - First observed
read_my_mood - First observed
recommend_for_mood - First observed
recommend_from_playlist - First observed
recommend_from_playlist_for_mood - First observed
recommend_from_song - First observed
record_feedback - First observed
refresh_library - First observed
songs_by_artist
TDQS
Scored across 10 tools
Tool names and descriptions clearly delineate purposes: recommend_from_song seeds by a song, recommend_from_playlist seeds by playlist, recommend_for_mood uses mood, recommend_from_playlist_for_mood combines both. songs_by_artist and explain_recommendation are distinct. Minor potential confusion between recommend_from_playlist_for_mood and recommend_for_mood, but descriptions explicitly guide selection.
All tool names follow a consistent verb_noun pattern (recommend_from_song, read_my_mood, record_feedback, etc.) with snake_case throughout, no deviations.
10 tools provide a well-scoped set covering recommendation generation, library management, feedback, mood reading, explanation, and status—each earns its place without excess.
Comprehensive lifecycle coverage: multiple recommendation entry points (by song, playlist, mood, playlist+mood), library refresh, mood inference, feedback recording, explanation, and index status. No obvious gaps for a music recommendation system.
Maintenance
Related MCP Connectors
MCP server for Producer/Riffusion AI music generation
Social media MCP server: your Instagram, TikTok, YouTube, LinkedIn and Threads history for your AI.
One MCP server over 253 data sources: Reddit, LinkedIn, YouTube, G2, search and AI answers.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables highly personalized music recommendations from TIDAL based on custom criteria, allowing users to create and manage playlists directly in their TIDAL account.7MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for managing YouTube Music playlists via Claude. Add and remove songs, create playlists, and ask Claude to suggest music — all through conversation.-
- FlicenseNot gradedqualityDmaintenanceA production-grade MCP server that connects YouTube Music to AI assistants, enabling music search, library management, playlist creation, and personalized recommendations through 15 tools, 3 resources, and 3 prompts.1-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI applications to search YouTube music videos and manage playlists via the YouTube Data API v3, with OAuth support for playlist and subscription management.3MIT