Skip to main content
Glama
superseoworld

MCP Spotify Server

get_audiobook_chapters

Retrieve chapter details for Spotify audiobooks using the audiobook ID to access structured listening information.

Instructions

Get Spotify catalog information about an audiobook's chapters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI for the audiobook
marketNoOptional. An ISO 3166-1 alpha-2 country code
limitNoMaximum number of chapters to return (1-50)
offsetNoThe index of the first chapter to return

Implementation Reference

  • The main handler function that extracts the audiobook ID, builds query parameters, and makes the Spotify API request to fetch chapters.
    async getAudiobookChapters(args: AudiobookChaptersArgs) {
      const audiobookId = this.extractAudiobookId(args.id);
      const { market, limit, offset } = args;
    
      const params = {
        market,
        ...(limit !== undefined && { limit }),
        ...(offset !== undefined && { offset })
      };
    
      return this.api.makeRequest(
        `/audiobooks/${audiobookId}/chapters${this.api.buildQueryString(params)}`
      );
    }
  • TypeScript interface defining the input parameters: required audiobook id, optional market, limit, offset.
    export interface AudiobookChaptersArgs extends MarketParams {
      id: string;
      limit?: number;
      offset?: number;
    }
  • src/index.ts:414-442 (registration)
    MCP tool registration in the listTools response, defining name, description, and JSON input schema.
    {
      name: 'get_audiobook_chapters',
      description: 'Get Spotify catalog information about an audiobook\'s chapters',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'The Spotify ID or URI for the audiobook'
          },
          market: {
            type: 'string',
            description: 'Optional. An ISO 3166-1 alpha-2 country code'
          },
          limit: {
            type: 'number',
            description: 'Maximum number of chapters to return (1-50)',
            minimum: 1,
            maximum: 50
          },
          offset: {
            type: 'number',
            description: 'The index of the first chapter to return',
            minimum: 0
          }
        },
        required: ['id']
      },
    },
  • src/index.ts:821-827 (registration)
    Dispatch logic in callTool handler that validates arguments and calls the audiobooks handler.
    case 'get_audiobook_chapters': {
      const args = this.validateArgs<AudiobookChaptersArgs>(request.params.arguments, ['id']);
      const result = await this.audiobooksHandler.getAudiobookChapters(args);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Helper function to extract the plain audiobook ID from a Spotify URI.
    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 for behavioral disclosure. It mentions 'catalog information' which implies read-only access, but doesn't specify authentication requirements, rate limits, pagination behavior (beyond what parameters suggest), error conditions, or response format. For a tool with 4 parameters and no output schema, this leaves significant behavioral gaps.

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 directly states the tool's purpose without unnecessary words. It's front-loaded with the core functionality and contains zero redundant information. Every word earns its place.

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

Completeness3/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 (4 parameters, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks behavioral context, usage guidelines, and output information. The 100% schema coverage helps, but without annotations or output schema, the description should do more to compensate.

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%, so the schema fully documents all 4 parameters. The description doesn't add any parameter-specific context beyond what's in the schema (e.g., it doesn't explain how 'market' affects results or provide examples of valid IDs). With complete schema coverage, the baseline score of 3 is appropriate.

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 about an audiobook's chapters'), making the purpose immediately understandable. It distinguishes from siblings like 'get_audiobook' by specifying chapters rather than general audiobook info, though it doesn't explicitly contrast with other chapter-related tools (none exist in the sibling list).

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 prerequisites (e.g., needing an audiobook ID), compare to similar tools like 'get_audiobook', or indicate scenarios where this is preferred over other catalog queries. Usage is implied but not explicitly stated.

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