Skip to main content
Glama

playlists_getPlaylistItems

Retrieve video items from a YouTube playlist by specifying the playlist ID. Use this tool to gather playlist content details, supporting structured data retrieval for analysis or integration purposes.

Instructions

Get videos in a YouTube playlist

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of results to return
playlistIdYesThe YouTube playlist ID

Implementation Reference

  • Core handler function that executes the tool logic by calling the YouTube API playlistItems.list endpoint to retrieve videos in the specified playlist.
    async getPlaylistItems({ 
      playlistId, 
      maxResults = 50 
    }: PlaylistItemsParams): Promise<any[]> {
      try {
        this.initialize();
        
        const response = await this.youtube.playlistItems.list({
          part: ['snippet', 'contentDetails'],
          playlistId,
          maxResults
        });
        
        return response.data.items || [];
      } catch (error) {
        throw new Error(`Failed to get playlist items: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • TypeScript interface defining the input parameters for the playlists_getPlaylistItems tool.
    export interface PlaylistItemsParams {
      playlistId: string;
      maxResults?: number;
    }
  • src/server.ts:145-162 (registration)
    Registers the tool in the MCP server's tools list, including name, description, and input schema validation.
    {
        name: 'playlists_getPlaylistItems',
        description: 'Get videos in a YouTube playlist',
        inputSchema: {
            type: 'object',
            properties: {
                playlistId: {
                    type: 'string',
                    description: 'The YouTube playlist ID',
                },
                maxResults: {
                    type: 'number',
                    description: 'Maximum number of results to return',
                },
            },
            required: ['playlistId'],
        },
    },
  • MCP server request handler that dispatches the tool call to the playlistService.getPlaylistItems method and formats the response.
    case 'playlists_getPlaylistItems': {
        const result = await playlistService.getPlaylistItems(args as unknown as PlaylistItemsParams);
        return {
            content: [{
                type: 'text',
                text: JSON.stringify(result, null, 2)
            }]
        };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior (e.g., how 'maxResults' interacts with total items), or error conditions. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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, clear sentence with no wasted words, efficiently conveying the core purpose. It's appropriately sized for a simple tool and front-loaded with essential information, making it easy for an agent to parse quickly.

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 tool use. It doesn't address behavioral aspects like safety (read vs. write), authentication needs, or output format (e.g., what data is returned for each video). For a tool with no structured behavioral hints, more context is needed to ensure reliable agent invocation.

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, clearly documenting both parameters ('playlistId' and 'maxResults'). The description adds no additional semantic context beyond what the schema provides, such as examples of playlist IDs or details on result ordering. With high schema coverage, the baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

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 the resource 'videos in a YouTube playlist', making the purpose specific and understandable. However, it doesn't differentiate from sibling tools like 'playlists_getPlaylist' (which might get playlist metadata rather than items) or 'channels_listVideos' (which might list videos from a channel), leaving some ambiguity about when to choose this tool over alternatives.

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. With siblings like 'playlists_getPlaylist' and 'channels_listVideos', there's no indication of context, prerequisites, or exclusions, leaving the agent to infer usage based on tool names alone.

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