Skip to main content
Glama

list_captions

Retrieve caption tracks for a YouTube video, including language, name, status, and draft status. Use this to inspect or manage subtitles.

Instructions

List caption tracks on a video with their language, name, status, and whether they are drafts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_idYesVideo ID to list captions for.

Implementation Reference

  • Registers the 'list_captions' tool on the MCP server with its schema and handler.
    server.tool(
      "list_captions",
      "List caption tracks on a video with their language, name, status, and whether they are drafts.",
      listCaptionsSchema,
      async (args) => {
        const res = await client.listCaptions(args.video_id);
        if (res.items.length === 0) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Video ${args.video_id} has no caption tracks.`,
              },
            ],
          };
        }
        const lines = [
          `Found ${res.items.length} caption track(s):`,
          ...res.items.map((c) => {
            const s = c.snippet ?? {};
            const draft = s.isDraft ? " [draft]" : "";
            const kind = s.trackKind ? ` (${s.trackKind})` : "";
            return `  ${c.id} — ${s.language ?? "?"} "${s.name ?? ""}"${kind} [${s.status ?? "?"}]${draft}`;
          }),
        ];
        return { content: [{ type: "text" as const, text: lines.join("\n") }] };
      },
    );
  • Zod schema defining the input for list_captions: requires a video_id string.
    const listCaptionsSchema = {
      video_id: z.string().describe("Video ID to list captions for."),
    };
  • Handler that calls client.listCaptions(video_id) and formats the response into a human-readable text listing of caption tracks.
    async (args) => {
      const res = await client.listCaptions(args.video_id);
      if (res.items.length === 0) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Video ${args.video_id} has no caption tracks.`,
            },
          ],
        };
      }
      const lines = [
        `Found ${res.items.length} caption track(s):`,
        ...res.items.map((c) => {
          const s = c.snippet ?? {};
          const draft = s.isDraft ? " [draft]" : "";
          const kind = s.trackKind ? ` (${s.trackKind})` : "";
          return `  ${c.id} — ${s.language ?? "?"} "${s.name ?? ""}"${kind} [${s.status ?? "?"}]${draft}`;
        }),
      ];
      return { content: [{ type: "text" as const, text: lines.join("\n") }] };
    },
  • Client helper method that calls the YouTube Data API v3 /captions endpoint with snippet part and videoId to retrieve caption track metadata.
    listCaptions(videoId: string): Promise<{
      items: Array<{
        id: string;
        snippet?: {
          name?: string;
          language?: string;
          status?: string;
          isDraft?: boolean;
          lastUpdated?: string;
          trackKind?: string;
        };
      }>;
    }> {
      return this.dataGet("/captions", { part: "snippet", videoId });
    }
  • src/server.ts:51-55 (registration)
    Import and call to registerCaptionTools which wires up the list_captions tool.
      registerCaptionTools(s, youtube);
      registerShortsTools(s, youtube);
      registerBridgeTools(s, youtube, comfyui, config.comfyUIDefaultCkpt);
      return s;
    };
Behavior3/5

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

No annotations provided; description only states what is listed without mentioning behavioral traits like pagination, read-only nature, or rate limits.

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?

Single sentence that is clear and to the point, with no unnecessary information.

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?

Lists fields returned, which compensates partially for missing output schema; but does not mention output format or pagination.

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 coverage is 100% and description adds no additional meaning beyond the schema's description of video_id.

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 it lists caption tracks on a video and specifies fields returned (language, name, status, draft status). Distinguishes from sibling tools like delete_caption and upload_caption.

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?

No explicit guidance on when to use this tool versus alternatives, but context of siblings (e.g., delete_caption) implies it is used for viewing before other actions.

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