Skip to main content
Glama
superseoworld

MCP Spotify Server

get_multiple_audiobooks

Retrieve Spotify catalog details for up to 50 audiobooks using their IDs or URIs, with optional market filtering.

Instructions

Get Spotify catalog information for multiple audiobooks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesArray of Spotify audiobook IDs or URIs (max 50)
marketNoOptional. An ISO 3166-1 alpha-2 country code

Implementation Reference

  • The main handler function that executes the tool logic: validates input, extracts audiobook IDs, constructs the Spotify API endpoint, and returns the response.
    async getMultipleAudiobooks(args: MultipleAudiobooksArgs) {
      const { ids, market } = args;
    
      if (ids.length === 0) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'At least one audiobook ID must be provided'
        );
      }
    
      if (ids.length > 50) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Maximum of 50 audiobook IDs allowed'
        );
      }
    
      const audiobookIds = ids.map(this.extractAudiobookId);
      const params = { market };
      
      return this.api.makeRequest(
        `/audiobooks?ids=${audiobookIds.join(',')}${this.api.buildQueryString(params)}`
      );
    }
  • src/index.ts:394-412 (registration)
    Tool registration in the MCP server's tools list, defining name, description, and input schema.
    {
      name: 'get_multiple_audiobooks',
      description: 'Get Spotify catalog information for multiple audiobooks',
      inputSchema: {
        type: 'object',
        properties: {
          ids: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of Spotify audiobook IDs or URIs (max 50)',
            maxItems: 50
          },
          market: {
            type: 'string',
            description: 'Optional. An ISO 3166-1 alpha-2 country code'
          }
        },
        required: ['ids']
      },
  • TypeScript interface defining the input arguments for the handler (ids array and optional market from base).
    export interface MultipleAudiobooksArgs extends MarketParams {
      ids: string[];
    }
  • src/index.ts:813-818 (registration)
    Dispatch logic in the CallToolRequestSchema handler that invokes the specific audiobooks handler.
    case 'get_multiple_audiobooks': {
      const args = this.validateArgs<MultipleAudiobooksArgs>(request.params.arguments, ['ids']);
      const result = await this.audiobooksHandler.getMultipleAudiobooks(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
  • Helper method used to normalize audiobook IDs/URIs by extracting the ID part.
    private extractAudiobookId(id: string): string {
      return id.startsWith('spotify:audiobook:') ? id.split(':')[2] : id;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states it retrieves 'catalog information' but doesn't detail what that includes (e.g., metadata, availability), response format, error handling, or constraints like rate limits. The description lacks critical context for a read operation in a rate-limited API environment.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It directly addresses what the tool does, making it easy to parse and understand quickly. Every word earns its place.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for effective tool use. It doesn't explain what 'catalog information' entails, response structure, error cases, or authentication needs. For a batch retrieval tool in a complex API like Spotify, more context is needed to complement the well-documented input schema.

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

Parameters3/5

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

Schema description coverage is 100%, with both parameters ('ids' and 'market') well-documented in the schema itself. The description adds no additional parameter semantics beyond implying batch retrieval via 'multiple audiobooks', which aligns with the 'ids' array parameter. This meets the baseline for high schema coverage.

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 description clearly states the verb ('Get') and resource ('Spotify catalog information for multiple audiobooks'), making the purpose immediately understandable. It distinguishes from sibling 'get_audiobook' by specifying 'multiple' audiobooks, though it doesn't explicitly contrast with other catalog lookup tools like 'get_multiple_albums' or 'get_multiple_artists' beyond the resource type.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer this over 'get_audiobook' (for single vs. batch retrieval) or other catalog tools, nor does it specify prerequisites like authentication or rate limits. Usage context is implied only by the tool name and description.

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/superseoworld/mcp-spotify'

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