Skip to main content
Glama

list_my_shorts

Scan recent uploads to find Shorts by filtering videos ≤60 seconds. Solves missing direct Shorts filter in YouTube Data API. Configure the number of uploads to scan.

Instructions

List your recent Shorts — scans the most recent uploads and filters to videos ≤60s. Useful when the Data API doesn't expose a direct Shorts filter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_candidatesNoHow many of the most recent uploads to scan. Shorts are detected by duration ≤ 60s after fetching.

Implementation Reference

  • The async handler function for list_my_shorts that scans recent uploads, filters videos with duration ≤ 60 seconds, and returns a formatted list of Shorts. It uses client.listMyUploads() to paginate through the most recent uploads up to max_candidates.
    async (args) => {
      const collected: Array<{ video: Video; seconds: number }> = [];
      let pageToken: string | undefined;
      let scanned = 0;
      while (scanned < args.max_candidates) {
        const batch = Math.min(50, args.max_candidates - scanned);
        const res = await client.listMyUploads(batch, pageToken);
        for (const v of res.items) {
          const s = parseIsoDurationSeconds(v.contentDetails?.duration);
          if (s !== null && s <= SHORTS_THRESHOLD_SECONDS) {
            collected.push({ video: v, seconds: s });
          }
        }
        scanned += res.items.length;
        if (!res.nextPageToken || res.items.length === 0) break;
        pageToken = res.nextPageToken;
      }
      if (collected.length === 0) {
        return {
          content: [
            {
              type: "text" as const,
              text: `No Shorts found in the most recent ${scanned} upload(s).`,
            },
          ],
        };
      }
      const lines = [
        `Found ${collected.length} Short(s) in the most recent ${scanned} upload(s):`,
        ...collected.map(({ video, seconds }) => {
          const title = video.snippet?.title ?? "(untitled)";
          const views = video.statistics?.viewCount ?? "0";
          return `  ${video.id} — ${title} [${seconds}s, ${views} views]`;
        }),
      ];
      return { content: [{ type: "text" as const, text: lines.join("\n") }] };
    },
  • Input schema for list_my_shorts defining a single parameter 'max_candidates' (int, 1-200, default 50) that controls how many recent uploads to scan.
    const listMyShortsSchema = {
      max_candidates: z
        .number()
        .int()
        .min(1)
        .max(200)
        .default(50)
        .describe(
          "How many of the most recent uploads to scan. Shorts are detected by duration ≤ 60s after fetching.",
        ),
    };
  • Registration of the list_my_shorts tool on the MCP server via server.tool(), with the name, description, schema, and handler.
    server.tool(
      "list_my_shorts",
      "List your recent Shorts — scans the most recent uploads and filters to videos ≤60s. Useful when the Data API doesn't expose a direct Shorts filter.",
      listMyShortsSchema,
  • src/server.ts:18-18 (registration)
    Import of registerShortsTools from shorts.ts into the main server module.
    import { registerShortsTools } from "./tools/shorts.js";
  • src/server.ts:52-52 (registration)
    Invocation of registerShortsTools(s, youtube) to register all shorts tools on the MCP server.
    registerShortsTools(s, youtube);
Behavior4/5

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

The description transparently explains the scanning and filtering behavior without relying on annotations, which are absent. It indicates a read-like operation with no destructive side effects.

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 extremely concise, consisting of two clear sentences with no redundant information. It is front-loaded and 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 the simple interface (one parameter, no output schema), the description sufficiently covers what the tool does and how it works. It could mention the output format but is adequate for a straightforward list tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds context to the 'max_candidates' parameter beyond the schema by explaining how Shorts are detected (duration check), enhancing understanding of the parameter's role.

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 the tool lists recent Shorts, differentiating from general video listing by specifying the filtering condition (≤60s) and distinguishing it from a direct API filter.

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 explicitly notes when the tool is useful (when Data API lacks a direct Shorts filter), providing context for usage, though it doesn't explicitly mention alternatives or when not to use.

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

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