Skip to main content
Glama
Spotify MCP Server

Spotify MCP Server

by jamiew

Search Spotify

search_music
Read-onlyIdempotent

Finds tracks, albums, artists, or playlists on Spotify using a query plus optional filters for year, genre, artist, and album, with pagination to page through large result sets.

Instructions

Search Spotify for tracks, albums, artists, or playlists.

Args:
    query: Search query
    qtype: Type ('track', 'album', 'artist', 'playlist')
    limit: Max results per page (1-50, default 10). Spotify caps search at 10
        per page for restricted apps and rejects anything larger; a larger
        limit is retried at the cap rather than failing. Check the returned
        `limit` for what was actually served, and use `offset` to go deeper.
    offset: Number of results to skip for pagination (default 0)
    year: Filter by year (e.g., '2024')
    year_range: Filter by year range (e.g., '2020-2024')
    genre: Filter by genre (e.g., 'electronic', 'hip-hop')
    artist: Filter by artist name
    album: Filter by album name

Returns:
    SearchResults with 'items' (list of tracks) and pagination info ('total', 'limit', 'offset')

Note: Filters use Spotify's search syntax. For large result sets, use offset to paginate.
Example: query='love', year='2024', genre='pop' searches for 'love year:2024 genre:pop'

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_music"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearNo
albumNo
genreNo
limitNo
qtypeNotrack
queryYes
artistNo
offsetNo
year_rangeNo

Output Schema

NameRequiredDescriptionDefault
nextNo
itemsYes
limitYes
totalYes
offsetYes
previousNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.8.1
    • addedOutput schema / $defs / Track / properties / show
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Show"
      +}
    • addedOutput schema / $defs / Track / properties / show_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Show Id"
      +}
    • addedOutput schema / $defs / Track / properties / type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Type"
      +}
  2. Addedv0.6.1

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, openWorld), but the description adds genuinely non-obvious behavior: Spotify caps at 10 per page for restricted apps, a larger limit is retried at the cap rather than failing, and the caller should read the returned `limit` to see what was actually served. The only blemish is 'items (list of tracks)', which is misleading when qtype is album, artist, or playlist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The Args/Returns/Note structure is clean, front-loaded with the one-line purpose, and the pagination caveat sits in the limit entry where the agent will read it. It runs slightly long, and the closing Note largely restates the example that precedes it, but no section is padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a nine-parameter search tool with a declared output schema, this is complete: filters, pagination, caps, retry behavior, return shape, and a worked example are all present. An agent has everything needed to construct a correct call and to iterate across pages without further guessing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does so: it documents all nine parameters, gives the string format for year and year_range ('2024', '2020-2024'), supplies genre examples, states the limit range and default, and explains offset's pagination role. The composed example ('love year:2024 genre:pop') clarifies how the filter params are actually translated into Spotify syntax.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

'Search Spotify for tracks, albums, artists, or playlists' gives a specific verb (search) plus the resource classes covered, and the qtype list makes the scope concrete. It doesn't explicitly differentiate from ID-based siblings like get_artist or get_tracks, so an agent must infer that this is the discovery path versus the direct-lookup path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description tells you how to page through large result sets ('use offset to go deeper') and how to combine filters, which is real usage guidance. However, it never states when to choose search_music over get_tracks, get_artist, get_album, or get_playlist, nor does it name any alternative — the when-not-to-use case is entirely left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.