Skip to main content
Glama

search_playlists

Search Spotify for public playlists using keywords, genres, or themes to discover curated music collections for specific activities, moods, or occasions.

Instructions

Search for public playlists using keywords, themes, or specific criteria to discover curated music collections.

🎯 USE CASES: • Discover playlists for specific moods, activities, or genres • Find curated music collections for events or occasions • Explore community-created playlists and music trends • Research popular playlist themes and curation styles • Find inspiration for creating your own playlist collections

📝 WHAT IT RETURNS: • Ranked playlist results based on search relevance • Playlist names, descriptions, and creator information • Follower counts, track counts, and playlist popularity • Playlist artwork and last modification dates • Links to explore and follow discovered playlists

🔍 EXAMPLES: • "Search for 'workout motivation' playlists" • "Find playlists with 'indie rock' in the title" • "Look for 'chill studying' playlist collections" • "Search for 'party music' playlists with many followers"

🔍 SEARCH STRATEGIES: • Use activity keywords: "running", "studying", "party" • Include genre terms: "jazz", "electronic", "country" • Try mood descriptors: "chill", "upbeat", "melancholy" • Combine terms: "indie folk acoustic", "90s hip hop" • Search for seasonal themes: "summer", "holiday", "spring"

💡 DISCOVERY BENEFITS: • Access to expertly curated music collections • Discover new artists through themed playlists • Find music for specific activities or moods • Learn about playlist curation and organization • Connect with music communities and trends

⚠️ REQUIREMENTS: • Valid Spotify access token • Results limited to public playlists only

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesSpotify access token for authentication
queryYesSearch query for playlists (name, keywords)
limitNo

Implementation Reference

  • Definition of the 'search_playlists' tool including title, description, schema, and handler. This object is part of playlistTools exported and included in the main tools registry.
      search_playlists: {
        title: "Search Playlists",
        description: `Search for public playlists using keywords, themes, or specific criteria to discover curated music collections.
    
    🎯 USE CASES:
    • Discover playlists for specific moods, activities, or genres
    • Find curated music collections for events or occasions
    • Explore community-created playlists and music trends
    • Research popular playlist themes and curation styles
    • Find inspiration for creating your own playlist collections
    
    📝 WHAT IT RETURNS:
    • Ranked playlist results based on search relevance
    • Playlist names, descriptions, and creator information
    • Follower counts, track counts, and playlist popularity
    • Playlist artwork and last modification dates
    • Links to explore and follow discovered playlists
    
    🔍 EXAMPLES:
    • "Search for 'workout motivation' playlists"
    • "Find playlists with 'indie rock' in the title"
    • "Look for 'chill studying' playlist collections"
    • "Search for 'party music' playlists with many followers"
    
    🔍 SEARCH STRATEGIES:
    • Use activity keywords: "running", "studying", "party"
    • Include genre terms: "jazz", "electronic", "country"
    • Try mood descriptors: "chill", "upbeat", "melancholy"
    • Combine terms: "indie folk acoustic", "90s hip hop"
    • Search for seasonal themes: "summer", "holiday", "spring"
    
    💡 DISCOVERY BENEFITS:
    • Access to expertly curated music collections
    • Discover new artists through themed playlists
    • Find music for specific activities or moods
    • Learn about playlist curation and organization
    • Connect with music communities and trends
    
    ⚠️ REQUIREMENTS:
    • Valid Spotify access token
    • Results limited to public playlists only`,
        schema: createSchema({
          token: commonSchemas.token(),
          query: commonSchemas.searchQuery("playlists (name, keywords)"),
          limit: commonSchemas.limit(1, 50, 20),
        }),
        handler: async (args: any, spotifyService: SpotifyService) => {
          const { token, query, limit = 20 } = args;
          return await spotifyService.searchPlaylists(token, query, limit);
        },
      },
  • Input schema for the search_playlists tool defining parameters: token (Spotify access token), query (search string), limit (optional, default 20, max 50).
    schema: createSchema({
      token: commonSchemas.token(),
      query: commonSchemas.searchQuery("playlists (name, keywords)"),
      limit: commonSchemas.limit(1, 50, 20),
    }),
  • Handler function for the MCP tool 'search_playlists' that validates args via schema and calls SpotifyService.searchPlaylists.
    handler: async (args: any, spotifyService: SpotifyService) => {
      const { token, query, limit = 20 } = args;
      return await spotifyService.searchPlaylists(token, query, limit);
    },
  • Core implementation in SpotifyService that performs the HTTP request to Spotify's /search endpoint with type=playlist, returning search results.
    async searchPlaylists(
      token: string,
      query: string,
      limit: number = 20
    ): Promise<SearchResult> {
      const params = {
        q: query,
        type: "playlist",
        limit: Math.min(limit, 50),
      };
      return await this.makeRequest<SearchResult>("search", token, params);
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context beyond basic functionality, such as specifying that results are 'limited to public playlists only' and require a 'valid Spotify access token'. However, it lacks details on rate limits, error handling, or pagination behavior, leaving gaps for a mutation-free but API-dependent tool.

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 description is well-structured with sections like 'USE CASES' and 'SEARCH STRATEGIES', but it is overly verbose with redundant information (e.g., 'DISCOVERY BENEFITS' repeats points from other sections). Sentences like 'Access to expertly curated music collections' could be condensed, and the front-loaded purpose is clear but followed by excessive elaboration that doesn't always add critical value.

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?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, examples, and requirements, but lacks details on output format (beyond a high-level 'WHAT IT RETURNS' list) and error cases. For a search tool with no output schema, more specifics on return structure would enhance completeness, but it's adequate overall.

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?

The input schema has 67% description coverage, with the 'limit' parameter missing a description. The description compensates by implying usage of 'keywords, themes, or specific criteria' for the 'query' parameter and mentioning authentication via 'Valid Spotify access token' for 'token', but does not explicitly detail parameter interactions or the 'limit' parameter's role. Since there are 3 parameters and the schema coverage is moderate, the description adds meaningful value, though not fully comprehensive.

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 clearly states the tool's purpose: 'Search for public playlists using keywords, themes, or specific criteria to discover curated music collections.' It specifies the verb ('search'), resource ('public playlists'), and scope ('discover curated music collections'), and distinguishes it from sibling tools like 'search_albums', 'search_artists', and 'search_tracks' by focusing exclusively on playlists.

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 provides clear context for when to use this tool through 'USE CASES' and 'SEARCH STRATEGIES' sections, which outline scenarios like discovering playlists for moods or genres and strategies like using activity keywords. However, it does not explicitly state when not to use it or name alternatives (e.g., 'search_music' or 'search_tracks'), which prevents a score of 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/latiftplgu/Spotify-OAuth-MCP-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server