Skip to main content
Glama

playlists_getPlaylist

Retrieve detailed information about a YouTube playlist, including its metadata and content, by providing the playlist ID through the YouTube MCP Server.

Instructions

Get information about a YouTube playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlistIdYesThe YouTube playlist ID

Implementation Reference

  • The core handler function that executes the playlists_getPlaylist tool logic by calling the YouTube API to retrieve playlist details.
    async getPlaylist({ 
      playlistId 
    }: PlaylistParams): Promise<any> {
      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)}`);
      }
    }
  • src/server.ts:222-229 (registration)
    Registers the tool handler in the MCP server's CallToolRequestHandler switch statement, delegating to PlaylistService.getPlaylist.
    case 'playlists_getPlaylist': {
        const result = await playlistService.getPlaylist(args as unknown as PlaylistParams);
        return {
            content: [{
                type: 'text',
                text: JSON.stringify(result, null, 2)
            }]
        };
  • Defines the tool schema (name, description, inputSchema) returned by ListToolsRequestHandler.
    {
        name: 'playlists_getPlaylist',
        description: 'Get information about a YouTube playlist',
        inputSchema: {
            type: 'object',
            properties: {
                playlistId: {
                    type: 'string',
                    description: 'The YouTube playlist ID',
                },
            },
            required: ['playlistId'],
        },
    },
  • TypeScript interface for the input parameters used in the tool handler and cast in the registration.
    export interface PlaylistParams {
      playlistId: string;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. It doesn't mention if this is a read-only operation, potential rate limits, authentication requirements, error conditions (e.g., invalid playlist IDs), or the format of returned information. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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 any fluff or redundancy. It's front-loaded with the core action ('Get information about'), making it easy to parse quickly. Every word earns its place, achieving optimal conciseness for such a straightforward tool.

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 the lack of annotations and output schema, the description is incomplete for effective use. It doesn't explain what information is returned (e.g., metadata like title, item count), potential behavioral traits (e.g., read-only nature, error handling), or usage context. For a tool that likely returns structured data, more detail is needed to compensate for the missing structured fields.

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?

The input schema has 100% description coverage, with the 'playlistId' parameter clearly documented as 'The YouTube playlist ID'. The description adds no additional semantic context beyond this, such as examples of valid IDs or where to find them. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema adequately handles parameter documentation.

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 information about') and resource ('a YouTube playlist'), making the purpose immediately understandable. It distinguishes itself from siblings like 'playlists_getPlaylistItems' (which retrieves items within playlists) by focusing on playlist metadata. However, it doesn't specify what information is retrieved (e.g., title, description, statistics), keeping it from a perfect score.

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. For example, it doesn't mention when to choose this over 'videos_getVideo' for video details or 'playlists_getPlaylistItems' for playlist content. There's no context about prerequisites, such as needing a valid playlist ID, leaving usage entirely implicit.

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

Related 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/ZubeidHendricks/youtube-mcp-server'

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