Skip to main content
Glama

get_audiobook

Retrieve Spotify catalog information for audiobooks by providing the audiobook ID or URI. Access details like title, author, chapters, and availability in specific markets.

Instructions

Get Spotify catalog information for an audiobook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Spotify ID or URI for the audiobook
marketNoOptional. An ISO 3166-1 alpha-2 country code

Implementation Reference

  • Core implementation of the get_audiobook tool: extracts ID from URI, calls Spotify API /audiobooks/{id} with market param.
    async getAudiobook(args: AudiobookArgs) { const audiobookId = this.extractAudiobookId(args.id); const { market } = args; const params = { market }; return this.api.makeRequest( `/audiobooks/${audiobookId}${this.api.buildQueryString(params)}` ); }
  • src/index.ts:377-392 (registration)
    Registration of the 'get_audiobook' tool in the MCP server's ListTools handler, including schema.
    name: 'get_audiobook', description: 'Get Spotify catalog information for an audiobook', 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' } }, required: ['id'] },
  • src/index.ts:805-811 (registration)
    Dispatch logic in CallToolRequest handler that invokes the audiobooksHandler.getAudiobook method.
    case 'get_audiobook': { const args = this.validateArgs<AudiobookArgs>(request.params.arguments, ['id']); const result = await this.audiobooksHandler.getAudiobook(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; }
  • TypeScript interface defining the input args for getAudiobook, extending MarketParams.
    export interface AudiobookArgs extends MarketParams { id: string; }
  • Helper function to normalize audiobook ID from Spotify URI.
    private extractAudiobookId(id: string): string { return id.startsWith('spotify:audiobook:') ? id.split(':')[2] : id; }

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