Skip to main content
Glama

list_library

Read-only

List saved YouTube videos from your library. Search by title or author, filter favorites, and paginate results.

Instructions

List videos the user has saved to their Library (transcripts + summaries). Supports substring search on title/author, favorites filter, and pagination. Returns recently saved items first. Scoped to the calling user's data only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
favoriteNoWhen true, return only items the user has favorited.
qNoSubstring match on title and author.
limitNoMax items per page (1-100, default 20).
offsetNoPagination offset (number of items to skip).

Implementation Reference

  • Tool schema definition for 'list_library' — includes name, description, annotations, and inputSchema with optional parameters: favorite (boolean), q (string for substring search), limit (number 1-100), offset (number for pagination).
    {
      name: "list_library",
      description:
        "List videos the user has saved to their Library (transcripts + summaries). Supports substring search on title/author, favorites filter, and pagination. Returns recently saved items first. Scoped to the calling user's data only.",
      annotations: { title: "List Saved Library", ...ANN.LIB_READ },
      inputSchema: {
        type: "object",
        properties: {
          favorite: {
            type: "boolean",
            description: "When true, return only items the user has favorited.",
          },
          q: {
            type: "string",
            description: "Substring match on title and author.",
          },
          limit: {
            type: "number",
            description: "Max items per page (1-100, default 20).",
            minimum: 1,
            maximum: 100,
          },
          offset: {
            type: "number",
            description: "Pagination offset (number of items to skip).",
            minimum: 0,
          },
        },
      },
    },
  • src/index.js:448-448 (registration)
    The 'list_library' tool is registered as part of the TOOLS array (line 73-406) which is returned by the ListToolsRequestSchema handler. When called, it's routed via CallToolRequestSchema (line 450) to callUpstream which forwards the tool name and args to the upstream server.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
  • The handler (callUpstream function) that executes the tool logic. For 'list_library', this function sends a tools/call JSON-RPC request to the upstream MCP server (https://api.subdownload.com/mcp) with the tool name and arguments, then returns the result. No local implementation — the actual logic lives on the upstream server.
    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;
    }
Behavior4/5

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

Annotations already mark readOnlyHint=true and destructiveHint=false, indicating safe reading. The description adds behavioral details: returns recently saved items first, supports substring search and favorites filter. This complements the annotations without contradiction.

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 two sentences: first states purpose and content type, second lists key features. It is front-loaded with the core action and avoids superfluous details, 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.

Completeness4/5

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

Given no output schema, the description explains ordering (recently saved first) and scope, but does not detail the structure of returned items beyond mentioning transcripts and summaries. It is reasonably complete for a list tool with well-documented parameters.

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 description coverage is 100%, so the schema already documents all parameters. The description summarizes parameter behavior (substring search, favorites filter, pagination) but does not add significant new meaning beyond what the schema provides.

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?

The description clearly states "List videos the user has saved to their Library" with specific verb (list) and resource (Library videos). It adds details like transcripts, summaries, and scoping, making it distinct from sibling tools such as list_channel_videos or search_youtube.

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 specifies the scope ("Scoped to the calling user's data only") and lists supported features (substring search, favorites filter, pagination). It implicitly tells when to use this tool (for user's own library) but does not explicitly contrast with alternatives or state when not to use it.

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