naftiko: 1.0.0-alpha2 info: label: Spotify Web API — Library description: 'Spotify Web API — Library. 32 operations. Lead operation: Get User''s Saved Albums. Self-contained Naftiko capability covering one Spotify business surface.' tags: - Spotify - Library created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: SPOTIFY_API_KEY: SPOTIFY_API_KEY capability: consumes: - type: http namespace: spotify-library baseUri: https://api.spotify.com/v1 description: Spotify Web API — Library business capability. Self-contained, no shared references. resources: - name: me-albums path: /me/albums operations: - name: getuserssavedalbums method: GET description: Get User's Saved Albums outputRawFormat: json outputParameters: - name: result type: object value: $. - name: savealbumsuser method: PUT description: Save Albums for Current User outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: removealbumsuser method: DELETE description: Remove Users' Saved Albums outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: me-albums-contains path: /me/albums/contains operations: - name: checkuserssavedalbums method: GET description: Check User's Saved Albums outputRawFormat: json outputParameters: - name: result type: object value: $. - name: me-audiobooks path: /me/audiobooks operations: - name: getuserssavedaudiobooks method: GET description: Get User's Saved Audiobooks outputRawFormat: json outputParameters: - name: result type: object value: $. - name: saveaudiobooksuser method: PUT description: Save Audiobooks for Current User outputRawFormat: json outputParameters: - name: result type: object value: $. - name: removeaudiobooksuser method: DELETE description: Remove User's Saved Audiobooks outputRawFormat: json outputParameters: - name: result type: object value: $. - name: me-audiobooks-contains path: /me/audiobooks/contains operations: - name: checkuserssavedaudiobooks method: GET description: Check User's Saved Audiobooks outputRawFormat: json outputParameters: - name: result type: object value: $. - name: me-episodes path: /me/episodes operations: - name: getuserssavedepisodes method: GET description: Get User's Saved Episodes outputRawFormat: json outputParameters: - name: result type: object value: $. - name: saveepisodesuser method: PUT description: Save Episodes for Current User outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: ids in: query type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: removeepisodesuser method: DELETE description: Remove User's Saved Episodes outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: me-episodes-contains path: /me/episodes/contains operations: - name: checkuserssavedepisodes method: GET description: Check User's Saved Episodes outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: ids in: query type: string required: true - name: me-following path: /me/following operations: - name: getfollowed method: GET description: Get Followed Artists outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: type in: query type: string required: true - name: after in: query type: string - name: limit in: query type: integer - name: followartistsusers method: PUT description: Follow Artists or Users outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: type in: query type: string required: true - name: ids in: query type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: unfollowartistsusers method: DELETE description: Unfollow Artists or Users outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: type in: query type: string required: true - name: ids in: query type: string required: true - name: body in: body type: object description: Request body (JSON). required: false - name: me-following-contains path: /me/following/contains operations: - name: checkcurrentuserfollows method: GET description: Check If User Follows Artists or Users outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: type in: query type: string required: true - name: ids in: query type: string required: true - name: me-library path: /me/library operations: - name: savelibraryitems method: PUT description: Save Items to Library outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: uris in: query type: string required: true - name: removelibraryitems method: DELETE description: Remove Items from Library outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: uris in: query type: string required: true - name: me-library-contains path: /me/library/contains operations: - name: checklibrarycontains method: GET description: Check User's Saved Items outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: uris in: query type: string required: true - name: me-playlists path: /me/playlists operations: - name: getalistofcurrentusersplaylists method: GET description: Get Current User's Playlists outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: offset in: query type: integer - name: createplaylist method: POST description: Create Playlist outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: me-shows path: /me/shows operations: - name: getuserssavedshows method: GET description: Get User's Saved Shows outputRawFormat: json outputParameters: - name: result type: object value: $. - name: saveshowsuser method: PUT description: Save Shows for Current User outputRawFormat: json outputParameters: - name: result type: object value: $. - name: removeshowsuser method: DELETE description: Remove User's Saved Shows outputRawFormat: json outputParameters: - name: result type: object value: $. - name: me-shows-contains path: /me/shows/contains operations: - name: checkuserssavedshows method: GET description: Check User's Saved Shows outputRawFormat: json outputParameters: - name: result type: object value: $. - name: me-top-type path: /me/top/{type} operations: - name: getuserstopartistsandtracks method: GET description: Get User's Top Items outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: type in: path type: string required: true - name: time_range in: query type: string - name: me-tracks path: /me/tracks operations: - name: getuserssavedtracks method: GET description: Get User's Saved Tracks outputRawFormat: json outputParameters: - name: result type: object value: $. - name: savetracksuser method: PUT description: Save Tracks for Current User outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: removetracksuser method: DELETE description: Remove User's Saved Tracks outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: me-tracks-contains path: /me/tracks/contains operations: - name: checkuserssavedtracks method: GET description: Check User's Saved Tracks outputRawFormat: json outputParameters: - name: result type: object value: $. - name: playlists-playlist_id path: /playlists/{playlist_id} operations: - name: changeplaylistdetails method: PUT description: Change Playlist Details outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: users-user_id-playlists path: /users/{user_id}/playlists operations: - name: createplaylistforuser method: POST description: Create Playlist for user outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false authentication: type: bearer token: '{{env.SPOTIFY_API_KEY}}' exposes: - type: rest namespace: spotify-library-rest port: 8080 description: REST adapter for Spotify Web API — Library. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/me/albums name: me-albums description: REST surface for me-albums. operations: - method: GET name: getuserssavedalbums description: Get User's Saved Albums call: spotify-library.getuserssavedalbums outputParameters: - type: object mapping: $. - method: PUT name: savealbumsuser description: Save Albums for Current User call: spotify-library.savealbumsuser with: body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: removealbumsuser description: Remove Users' Saved Albums call: spotify-library.removealbumsuser with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/me/albums/contains name: me-albums-contains description: REST surface for me-albums-contains. operations: - method: GET name: checkuserssavedalbums description: Check User's Saved Albums call: spotify-library.checkuserssavedalbums outputParameters: - type: object mapping: $. - path: /v1/me/audiobooks name: me-audiobooks description: REST surface for me-audiobooks. operations: - method: GET name: getuserssavedaudiobooks description: Get User's Saved Audiobooks call: spotify-library.getuserssavedaudiobooks outputParameters: - type: object mapping: $. - method: PUT name: saveaudiobooksuser description: Save Audiobooks for Current User call: spotify-library.saveaudiobooksuser outputParameters: - type: object mapping: $. - method: DELETE name: removeaudiobooksuser description: Remove User's Saved Audiobooks call: spotify-library.removeaudiobooksuser outputParameters: - type: object mapping: $. - path: /v1/me/audiobooks/contains name: me-audiobooks-contains description: REST surface for me-audiobooks-contains. operations: - method: GET name: checkuserssavedaudiobooks description: Check User's Saved Audiobooks call: spotify-library.checkuserssavedaudiobooks outputParameters: - type: object mapping: $. - path: /v1/me/episodes name: me-episodes description: REST surface for me-episodes. operations: - method: GET name: getuserssavedepisodes description: Get User's Saved Episodes call: spotify-library.getuserssavedepisodes outputParameters: - type: object mapping: $. - method: PUT name: saveepisodesuser description: Save Episodes for Current User call: spotify-library.saveepisodesuser with: ids: rest.ids body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: removeepisodesuser description: Remove User's Saved Episodes call: spotify-library.removeepisodesuser with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/me/episodes/contains name: me-episodes-contains description: REST surface for me-episodes-contains. operations: - method: GET name: checkuserssavedepisodes description: Check User's Saved Episodes call: spotify-library.checkuserssavedepisodes with: ids: rest.ids outputParameters: - type: object mapping: $. - path: /v1/me/following name: me-following description: REST surface for me-following. operations: - method: GET name: getfollowed description: Get Followed Artists call: spotify-library.getfollowed with: type: rest.type after: rest.after limit: rest.limit outputParameters: - type: object mapping: $. - method: PUT name: followartistsusers description: Follow Artists or Users call: spotify-library.followartistsusers with: type: rest.type ids: rest.ids body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: unfollowartistsusers description: Unfollow Artists or Users call: spotify-library.unfollowartistsusers with: type: rest.type ids: rest.ids body: rest.body outputParameters: - type: object mapping: $. - path: /v1/me/following/contains name: me-following-contains description: REST surface for me-following-contains. operations: - method: GET name: checkcurrentuserfollows description: Check If User Follows Artists or Users call: spotify-library.checkcurrentuserfollows with: type: rest.type ids: rest.ids outputParameters: - type: object mapping: $. - path: /v1/me/library name: me-library description: REST surface for me-library. operations: - method: PUT name: savelibraryitems description: Save Items to Library call: spotify-library.savelibraryitems with: uris: rest.uris outputParameters: - type: object mapping: $. - method: DELETE name: removelibraryitems description: Remove Items from Library call: spotify-library.removelibraryitems with: uris: rest.uris outputParameters: - type: object mapping: $. - path: /v1/me/library/contains name: me-library-contains description: REST surface for me-library-contains. operations: - method: GET name: checklibrarycontains description: Check User's Saved Items call: spotify-library.checklibrarycontains with: uris: rest.uris outputParameters: - type: object mapping: $. - path: /v1/me/playlists name: me-playlists description: REST surface for me-playlists. operations: - method: GET name: getalistofcurrentusersplaylists description: Get Current User's Playlists call: spotify-library.getalistofcurrentusersplaylists with: offset: rest.offset outputParameters: - type: object mapping: $. - method: POST name: createplaylist description: Create Playlist call: spotify-library.createplaylist with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/me/shows name: me-shows description: REST surface for me-shows. operations: - method: GET name: getuserssavedshows description: Get User's Saved Shows call: spotify-library.getuserssavedshows outputParameters: - type: object mapping: $. - method: PUT name: saveshowsuser description: Save Shows for Current User call: spotify-library.saveshowsuser outputParameters: - type: object mapping: $. - method: DELETE name: removeshowsuser description: Remove User's Saved Shows call: spotify-library.removeshowsuser outputParameters: - type: object mapping: $. - path: /v1/me/shows/contains name: me-shows-contains description: REST surface for me-shows-contains. operations: - method: GET name: checkuserssavedshows description: Check User's Saved Shows call: spotify-library.checkuserssavedshows outputParameters: - type: object mapping: $. - path: /v1/me/top/{type} name: me-top-type description: REST surface for me-top-type. operations: - method: GET name: getuserstopartistsandtracks description: Get User's Top Items call: spotify-library.getuserstopartistsandtracks with: type: rest.type time_range: rest.time_range outputParameters: - type: object mapping: $. - path: /v1/me/tracks name: me-tracks description: REST surface for me-tracks. operations: - method: GET name: getuserssavedtracks description: Get User's Saved Tracks call: spotify-library.getuserssavedtracks outputParameters: - type: object mapping: $. - method: PUT name: savetracksuser description: Save Tracks for Current User call: spotify-library.savetracksuser with: body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: removetracksuser description: Remove User's Saved Tracks call: spotify-library.removetracksuser with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/me/tracks/contains name: me-tracks-contains description: REST surface for me-tracks-contains. operations: - method: GET name: checkuserssavedtracks description: Check User's Saved Tracks call: spotify-library.checkuserssavedtracks outputParameters: - type: object mapping: $. - path: /v1/playlists/{playlist-id} name: playlists-playlist-id description: REST surface for playlists-playlist_id. operations: - method: PUT name: changeplaylistdetails description: Change Playlist Details call: spotify-library.changeplaylistdetails with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/users/{user-id}/playlists name: users-user-id-playlists description: REST surface for users-user_id-playlists. operations: - method: POST name: createplaylistforuser description: Create Playlist for user call: spotify-library.createplaylistforuser with: body: rest.body outputParameters: - type: object mapping: $. - type: mcp namespace: spotify-library-mcp port: 9090 transport: http description: MCP adapter for Spotify Web API — Library. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-user-s-saved-albums description: Get User's Saved Albums hints: readOnly: true destructive: false idempotent: true call: spotify-library.getuserssavedalbums outputParameters: - type: object mapping: $. - name: save-albums-current-user description: Save Albums for Current User hints: readOnly: false destructive: false idempotent: true call: spotify-library.savealbumsuser with: body: tools.body outputParameters: - type: object mapping: $. - name: remove-users-saved-albums description: Remove Users' Saved Albums hints: readOnly: false destructive: true idempotent: true call: spotify-library.removealbumsuser with: body: tools.body outputParameters: - type: object mapping: $. - name: check-user-s-saved-albums description: Check User's Saved Albums hints: readOnly: true destructive: false idempotent: true call: spotify-library.checkuserssavedalbums outputParameters: - type: object mapping: $. - name: get-user-s-saved-audiobooks description: Get User's Saved Audiobooks hints: readOnly: true destructive: false idempotent: true call: spotify-library.getuserssavedaudiobooks outputParameters: - type: object mapping: $. - name: save-audiobooks-current-user description: Save Audiobooks for Current User hints: readOnly: false destructive: false idempotent: true call: spotify-library.saveaudiobooksuser outputParameters: - type: object mapping: $. - name: remove-user-s-saved-audiobooks description: Remove User's Saved Audiobooks hints: readOnly: false destructive: true idempotent: true call: spotify-library.removeaudiobooksuser outputParameters: - type: object mapping: $. - name: check-user-s-saved-audiobooks description: Check User's Saved Audiobooks hints: readOnly: true destructive: false idempotent: true call: spotify-library.checkuserssavedaudiobooks outputParameters: - type: object mapping: $. - name: get-user-s-saved-episodes description: Get User's Saved Episodes hints: readOnly: true destructive: false idempotent: true call: spotify-library.getuserssavedepisodes outputParameters: - type: object mapping: $. - name: save-episodes-current-user description: Save Episodes for Current User hints: readOnly: false destructive: false idempotent: true call: spotify-library.saveepisodesuser with: ids: tools.ids body: tools.body outputParameters: - type: object mapping: $. - name: remove-user-s-saved-episodes description: Remove User's Saved Episodes hints: readOnly: false destructive: true idempotent: true call: spotify-library.removeepisodesuser with: body: tools.body outputParameters: - type: object mapping: $. - name: check-user-s-saved-episodes description: Check User's Saved Episodes hints: readOnly: true destructive: false idempotent: true call: spotify-library.checkuserssavedepisodes with: ids: tools.ids outputParameters: - type: object mapping: $. - name: get-followed-artists description: Get Followed Artists hints: readOnly: true destructive: false idempotent: true call: spotify-library.getfollowed with: type: tools.type after: tools.after limit: tools.limit outputParameters: - type: object mapping: $. - name: follow-artists-users description: Follow Artists or Users hints: readOnly: false destructive: false idempotent: true call: spotify-library.followartistsusers with: type: tools.type ids: tools.ids body: tools.body outputParameters: - type: object mapping: $. - name: unfollow-artists-users description: Unfollow Artists or Users hints: readOnly: false destructive: true idempotent: true call: spotify-library.unfollowartistsusers with: type: tools.type ids: tools.ids body: tools.body outputParameters: - type: object mapping: $. - name: check-if-user-follows-artists description: Check If User Follows Artists or Users hints: readOnly: true destructive: false idempotent: true call: spotify-library.checkcurrentuserfollows with: type: tools.type ids: tools.ids outputParameters: - type: object mapping: $. - name: save-items-library description: Save Items to Library hints: readOnly: false destructive: false idempotent: true call: spotify-library.savelibraryitems with: uris: tools.uris outputParameters: - type: object mapping: $. - name: remove-items-library description: Remove Items from Library hints: readOnly: false destructive: true idempotent: true call: spotify-library.removelibraryitems with: uris: tools.uris outputParameters: - type: object mapping: $. - name: check-user-s-saved-items description: Check User's Saved Items hints: readOnly: true destructive: false idempotent: true call: spotify-library.checklibrarycontains with: uris: tools.uris outputParameters: - type: object mapping: $. - name: get-current-user-s-playlists description: Get Current User's Playlists hints: readOnly: true destructive: false idempotent: true call: spotify-library.getalistofcurrentusersplaylists with: offset: tools.offset outputParameters: - type: object mapping: $. - name: create-playlist description: Create Playlist hints: readOnly: false destructive: false idempotent: false call: spotify-library.createplaylist with: body: tools.body outputParameters: - type: object mapping: $. - name: get-user-s-saved-shows description: Get User's Saved Shows hints: readOnly: true destructive: false idempotent: true call: spotify-library.getuserssavedshows outputParameters: - type: object mapping: $. - name: save-shows-current-user description: Save Shows for Current User hints: readOnly: false destructive: false idempotent: true call: spotify-library.saveshowsuser outputParameters: - type: object mapping: $. - name: remove-user-s-saved-shows description: Remove User's Saved Shows hints: readOnly: false destructive: true idempotent: true call: spotify-library.removeshowsuser outputParameters: - type: object mapping: $. - name: check-user-s-saved-shows description: Check User's Saved Shows hints: readOnly: true destructive: false idempotent: true call: spotify-library.checkuserssavedshows outputParameters: - type: object mapping: $. - name: get-user-s-top-items description: Get User's Top Items hints: readOnly: true destructive: false idempotent: true call: spotify-library.getuserstopartistsandtracks with: type: tools.type time_range: tools.time_range outputParameters: - type: object mapping: $. - name: get-user-s-saved-tracks description: Get User's Saved Tracks hints: readOnly: true destructive: false idempotent: true call: spotify-library.getuserssavedtracks outputParameters: - type: object mapping: $. - name: save-tracks-current-user description: Save Tracks for Current User hints: readOnly: false destructive: false idempotent: true call: spotify-library.savetracksuser with: body: tools.body outputParameters: - type: object mapping: $. - name: remove-user-s-saved-tracks description: Remove User's Saved Tracks hints: readOnly: false destructive: true idempotent: true call: spotify-library.removetracksuser with: body: tools.body outputParameters: - type: object mapping: $. - name: check-user-s-saved-tracks description: Check User's Saved Tracks hints: readOnly: true destructive: false idempotent: true call: spotify-library.checkuserssavedtracks outputParameters: - type: object mapping: $. - name: change-playlist-details description: Change Playlist Details hints: readOnly: false destructive: false idempotent: true call: spotify-library.changeplaylistdetails with: body: tools.body outputParameters: - type: object mapping: $. - name: create-playlist-user description: Create Playlist for user hints: readOnly: true destructive: false idempotent: false call: spotify-library.createplaylistforuser with: body: tools.body outputParameters: - type: object mapping: $.