Skip to main content
Glama

list_my_videos

List your own YouTube videos with details like titles, view counts, and privacy status. Results are sorted newest first, with pagination support.

Instructions

List videos on the authenticated channel (newest first via the uploads playlist). Returns video IDs, titles, view counts, and privacy status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_resultsNo
page_tokenNo

Implementation Reference

  • The tool registration and handler for 'list_my_videos'. Calls client.listMyUploads() and formats results as text with video IDs, titles, views, and privacy status.
    server.tool(
      "list_my_videos",
      "List videos on the authenticated channel (newest first via the uploads playlist). Returns video IDs, titles, view counts, and privacy status.",
      listMyVideosSchema,
      async (args) => {
        const res = await client.listMyUploads(args.max_results, args.page_token);
        const lines = [
          `Found ${res.items.length} video(s):`,
          ...res.items.map((v) => {
            const title = v.snippet?.title ?? "(untitled)";
            const views = v.statistics?.viewCount ?? "0";
            const privacy = v.status?.privacyStatus ?? "?";
            return `  ${v.id} — ${title} [${views} views, ${privacy}]`;
          }),
          res.nextPageToken ? `next page_token: ${res.nextPageToken}` : "(end of results)",
        ];
        return { content: [{ type: "text" as const, text: lines.join("\n") }] };
      },
    );
  • Input schema for 'list_my_videos': max_results (1-50, default 25) and optional page_token.
    const listMyVideosSchema = {
      max_results: z.number().int().min(1).max(50).default(25),
      page_token: z.string().optional(),
    };
  • src/server.ts:13-47 (registration)
    Import and registration of registerVideoTools on the MCP server with the YouTubeClient instance.
    import { registerVideoTools } from "./tools/videos.js";
    import { registerPlaylistTools } from "./tools/playlists.js";
    import { registerCommentTools } from "./tools/comments.js";
    import { registerAnalyticsTool } from "./tools/analytics.js";
    import { registerCaptionTools } from "./tools/captions.js";
    import { registerShortsTools } from "./tools/shorts.js";
    import { registerBridgeTools } from "./tools/bridge.js";
    
    export interface ServerConfig {
      host: string;
      port: number;
      clientId: string;
      clientSecret: string;
      tokenFile: string;
      comfyUIUrl?: string;
      comfyUIDefaultCkpt: string;
    }
    
    interface Session {
      server: McpServer;
      transport: StreamableHTTPServerTransport;
    }
    
    function buildContext(config: ServerConfig) {
      const youtube = new YouTubeClient({
        clientId: config.clientId,
        clientSecret: config.clientSecret,
        tokenFile: config.tokenFile,
      });
      const comfyui = config.comfyUIUrl
        ? new ComfyUIClient({ baseUrl: config.comfyUIUrl })
        : null;
      const buildServer = () => {
        const s = new McpServer({ name: "youtube-mcp", version: "0.1.0" });
        registerVideoTools(s, youtube);
  • listMyUploads() method that delegates to listMyVideoIdsViaUploadsPlaylist for fetching the authenticated user's uploaded videos.
    listMyUploads(maxResults = 25, pageToken?: string): Promise<VideoListResponse> {
      return this.listMyVideoIdsViaUploadsPlaylist(maxResults, pageToken);
    }
  • listMyVideoIdsViaUploadsPlaylist() fetches the uploads playlist from the channel, retrieves video IDs, then fetches full video details (snippet, status, statistics, contentDetails).
    private async listMyVideoIdsViaUploadsPlaylist(
      maxResults: number,
      pageToken?: string,
    ): Promise<VideoListResponse> {
      const channels = await this.dataGet<{ items: Channel[] }>("/channels", {
        part: "contentDetails",
        mine: "true",
      });
      const uploadsPlaylist =
        channels.items[0]?.contentDetails?.relatedPlaylists?.uploads;
      if (!uploadsPlaylist) {
        return { items: [] };
      }
      const playlistItems = await this.dataGet<{
        items: Array<{ contentDetails: { videoId: string } }>;
        nextPageToken?: string;
      }>("/playlistItems", {
        part: "contentDetails",
        playlistId: uploadsPlaylist,
        maxResults: String(maxResults),
        pageToken,
      });
      const ids = playlistItems.items.map((i) => i.contentDetails.videoId);
      if (ids.length === 0) return { items: [], nextPageToken: playlistItems.nextPageToken };
      const videos = await this.dataGet<{ items: Video[] }>("/videos", {
        part: "snippet,status,statistics,contentDetails",
        id: ids.join(","),
      });
      return { items: videos.items, nextPageToken: playlistItems.nextPageToken };
    }
Behavior4/5

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

With no annotations, the description carries the full burden. It transparently states the operation is a read-only list ('list videos'), specifies ordering, and lists return fields. It does not mention pagination behavior or rate limits, but for a straightforward list tool, this is adequate and does not mislead.

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, well-structured sentence that front-loads the main purpose and includes key details (ordering, return fields). Every part earns its place; no unnecessary words.

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

Completeness3/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 does explain return values. However, it omits pagination behavior (how to use page_token) and does not differentiate from sibling tools. It is adequate for a simple list but could be more complete with pagination details.

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

Parameters1/5

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

The schema has 2 parameters with 0% description coverage, meaning no parameter descriptions exist in the schema. The description adds no explanation for 'max_results' or 'page_token', failing to compensate for the schema gap. The only info is that the list is paginated (implied by page_token) but not stated explicitly.

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 verb 'list', the resource 'videos on the authenticated channel', and specifies ordering ('newest first via the uploads playlist'). It also enumerates the returned fields (IDs, titles, view counts, privacy status). This differentiates it from sibling tools like 'list_my_shorts' (shorts) and 'get_video' (single video).

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

Usage Guidelines3/5

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

The description implies usage for listing own videos but provides no explicit guidance on when to use this tool versus alternatives (e.g., 'list_my_shorts' for shorts or 'get_video' for details). No when-not-to-use or prerequisites are mentioned. The context is implied but not clarified.

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