Skip to main content
Glama

playlists_getPlaylist

Retrieve YouTube playlist details including videos, metadata, and channel information by providing the playlist ID. Use this tool to access structured data from YouTube playlists for analysis or integration.

Instructions

Get information about a YouTube playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlistIdYesThe YouTube playlist ID

Implementation Reference

  • Core handler implementation in PlaylistService.getPlaylist() that initializes YouTube API client and fetches playlist details using playlists.list API.
    async getPlaylist({ playlistId }: PlaylistParams): Promise<unknown> { try { this.initialize(); const response = await this.youtube.playlists.list({ part: ['snippet', 'contentDetails'], id: [playlistId] }); return response.data.items?.[0] || null; } catch (error) { throw new Error(`Failed to get playlist: ${error instanceof Error ? error.message : String(error)}`); } }
  • Registers the 'playlists_getPlaylist' MCP tool, including input schema validation with Zod and thin wrapper handler delegating to PlaylistService.
    server.registerTool( 'playlists_getPlaylist', { title: 'Get Playlist Information', description: 'Get information about a YouTube playlist', annotations: { readOnlyHint: true, idempotentHint: true }, inputSchema: { playlistId: z.string().describe('The YouTube playlist ID'), }, }, async ({ playlistId }) => { const result = await playlistService.getPlaylist({ playlistId }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } );

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/sfiorini/youtube-mcp'

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