Skip to main content
Glama

list_playlist_videos

Read-only

List videos in a YouTube playlist in order with pagination. Get video metadata, position, and support for public or unlisted playlists using URL or ID.

Instructions

List videos in a YouTube playlist in order, with pagination. Returns video metadata and position within the playlist. Works for any public or unlisted playlist exposed by its URL/ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playlistNoPlaylist URL or ID (typically starts with 'PL', 'UU', 'LL', or 'FL'). Required for the first page.
continuationNoPagination token from a previous response's `continuation` field. Omit for the first page.

Implementation Reference

  • src/index.js:273-292 (registration)
    Tool 'list_playlist_videos' is registered in the TOOLS array with its metadata, description, annotations, and inputSchema. It accepts 'playlist' (required for first page) and 'continuation' (pagination token) parameters.
    {
      name: "list_playlist_videos",
      description:
        "List videos in a YouTube playlist in order, with pagination. Returns video metadata and position within the playlist. Works for any public or unlisted playlist exposed by its URL/ID.",
      annotations: { title: "List Playlist Videos", ...ANN.YT_READ },
      inputSchema: {
        type: "object",
        properties: {
          playlist: {
            type: "string",
            description:
              "Playlist URL or ID (typically starts with 'PL', 'UU', 'LL', or 'FL'). Required for the first page.",
          },
          continuation: {
            type: "string",
            description: "Pagination token from a previous response's `continuation` field. Omit for the first page.",
          },
        },
      },
    },
  • The CallToolRequestSchema handler forwards any tool call (including 'list_playlist_videos') to the upstream MCP server via callUpstream, which posts to the remote endpoint with the Bearer token.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await callUpstream(
          request.params.name,
          request.params.arguments || {}
        );
      } catch (err) {
        return {
          content: [{ type: "text", text: err.message || String(err) }],
          isError: true,
        };
      }
    });
  • The callUpstream function is the generic helper that forwards tool calls (by name and arguments) to the upstream MCP endpoint. It handles JSON response parsing and error reporting.
    async function callUpstream(name, args) {
      if (!API_KEY) {
        throw new Error(
          "SUBDOWNLOAD_API_KEY env var is not set. Get one at https://subdownload.com/account, then run with -e SUBDOWNLOAD_API_KEY=<your-key>."
        );
      }
      const res = await fetch(UPSTREAM_URL, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Accept: "application/json, text/event-stream",
          Authorization: `Bearer ${API_KEY}`,
        },
        body: JSON.stringify({
          jsonrpc: "2.0",
          id: Date.now(),
          method: "tools/call",
          params: { name, arguments: args },
        }),
      });
      const text = await res.text();
      let body;
      try {
        body = JSON.parse(text);
      } catch {
        throw new Error(
          `Upstream returned non-JSON response (HTTP ${res.status}): ${text.slice(0, 200)}`
        );
      }
      if (body.error) {
        throw new Error(body.error.message || JSON.stringify(body.error));
      }
      return body.result;
    }
  • Input schema for list_playlist_videos: accepts 'playlist' (string, URL or ID like PL..., UU..., LL..., FL...) and 'continuation' (string, pagination token). No required fields (since continuation can be used alone).
    inputSchema: {
      type: "object",
      properties: {
        playlist: {
          type: "string",
          description:
            "Playlist URL or ID (typically starts with 'PL', 'UU', 'LL', or 'FL'). Required for the first page.",
        },
        continuation: {
          type: "string",
          description: "Pagination token from a previous response's `continuation` field. Omit for the first page.",
        },
      },
    },
Behavior5/5

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

Description supplements annotations by disclosing pagination behavior, the order of returned videos, and that it works for public/unlisted playlists. This goes beyond the readOnlyHint and destructiveHint annotations, providing useful behavioral context.

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?

Three short, front-loaded sentences each add unique value: listing operation, pagination, return info, and scope. No extraneous content. Highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and moderate complexity, the description covers purpose, scope, and pagination adequately. It mentions returning 'video metadata and position' but is slightly vague on exact fields. Still sufficient for an AI to use effectively.

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?

Schema descriptions already cover both parameters (playlist and continuation) with full detail. The tool description adds no new information about parameter semantics beyond 'pagination' context, which is already implied by the schema. With 100% schema coverage, baseline is 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool lists videos in a YouTube playlist in order with pagination, and specifies it returns video metadata and position. The verb 'list' and resource 'videos in a YouTube playlist' are explicit, and it distinguishes itself from siblings like search_youtube and list_channel_videos.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description indicates when to use the tool: for any public or unlisted playlist identified by URL/ID. It implies that this is the relevant tool for playlist content, but does not explicitly discuss when not to use it or compare against alternatives.

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

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/SubDownload/subdownload-mcp'

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