Skip to main content
Glama
Spotify MCP Server

Spotify MCP Server

by jamiew

Top Artists and Tracks

get_top_items
Read-onlyIdempotent

Retrieve a user's top artists or tracks for a chosen time range and limit, providing ranked listening data when recommendations or related artists are unavailable.

Instructions

Get the user's top artists or tracks over a time range.

This remains useful when recommendations or related artists are unavailable
to the app. Spotify's policy also restricts analysis and AI ingestion.

Args:
    item_type: 'tracks' or 'artists' (default 'tracks')
    time_range: 'short_term' (~4 weeks), 'medium_term' (~6 months) or 'long_term'
    limit: Max items to return (1-50, default 20)

Returns:
    TopItems with either 'tracks' or 'artists' populated

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_top_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
item_typeNotracks
time_rangeNomedium_term

Output Schema

NameRequiredDescriptionDefault
tracksNo
artistsNo
time_rangeYes

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

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, so the safety profile is covered. The description adds a real behavioral fact — that Spotify policy restricts analysis/AI ingestion of this data — plus the return shape, but says nothing about auth scope or rate limits for an open-world call.

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

Conciseness3/5

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

The Args/Returns structure is easy to scan, but the second sentence about recommendation availability and Spotify policy is tangential framing that does not help an agent call the tool, and 'Returns' restates what the output schema already declares.

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

Completeness4/5

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

For a simple three-optional-parameter read tool with no required args and an output schema, the definition covers operation, parameter values and defaults adequately. It falls short only on invoking-context details such as scopes or what happens with empty history.

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

Parameters4/5

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

Schema coverage is 0%, so the description carries the burden and largely does: it enumerates item_type values, spells out limit as 1-50 with default 20, and decodes time_range into approximate durations (~4 weeks, ~6 months), which the schema's bare strings do not. It omits the schema's own default for time_range (medium_term) and gives no format guidance beyond the labels.

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?

The first sentence gives a specific verb and resource ('Get the user's top artists or tracks') plus a scope qualifier (time range), which separates it from list-type siblings like get_followed_artists or get_saved_tracks. The remaining sentences do not name any sibling, so the differentiation is implicit rather than stated.

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?

Usage is only implied: the note that it 'remains useful when recommendations or related artists are unavailable' hints at a fallback scenario but never tells the agent when to pick this over get_followed_artists, get_artist, or get_tracks. There are no exclusions or prerequisites.

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