Skip to main content
Glama
jamiew

Spotify MCP Server

by jamiew

Search Spotify

search_music
Read-onlyIdempotent

Search Spotify for tracks, albums, artists, or playlists by query. Filter results by year, genre, artist, or album, and paginate with offset.

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'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNo
albumNo
genreNo
limitNo
qtypeNotrack
queryYes
artistNo
offsetNo
year_rangeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nextNo
itemsYes
limitYes
totalYes
offsetYes
previousNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.1

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, the description discloses a non-obvious behavior: Spotify caps search at 10 per page for restricted apps and retries larger limits at the cap rather than failing. It also tells the agent to check the returned limit and use offset for deeper pagination, which is valuable behavioral guidance.

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 description is structured into Args, Returns, Note, and Example, making it scannable and front-loaded. It is longer than a one-liner, but the extra length is justified by the nine parameters and the pagination quirk; no filler is present.

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 search tool with an output schema and rich annotations, the description covers all the operational essentials: query types, all filters, limit/offset behavior, the API cap, the returned fields, and a concrete example. Nothing an agent needs to call this correctly is missing.

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 must fully compensate, and it does. Every parameter is documented with a concise semantic explanation, limit includes its range and default plus the retry behavior, qtype lists the accepted values, and the example shows how filters combine into Spotify's search syntax.

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

Purpose5/5

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

The description opens with a specific action ('Search Spotify') and explicitly enumerates the resource types: tracks, albums, artists, or playlists. It is immediately distinguishable from sibling get_* tools, none of which perform free-text search.

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

Usage Guidelines4/5

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

The description gives clear context for when to use the tool: searching by query and optionally filtering by year, genre, artist, etc. It does not explicitly name alternatives like get_tracks for when an ID is already known, but the search-focused framing and the sibling tool names make the appropriate usage clear.

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