Skip to main content
Glama
Decodo

Decodo MCP Server

youtube_subtitles

Read-only

Retrieve subtitles from any YouTube video by providing its video ID. Supports specifying a language code for localized captions.

Instructions

Scrape YouTube video subtitles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesYouTube video ID (e.g., "L8zSWbQN-v8")
language_codeNoLanguage code for subtitles (e.g., "en", "es")

Implementation Reference

  • The async handler function that calls the ScraperAPI client with youtube_subtitles target and returns the subtitles data as text content.
      async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
        const params = {
          ...scrapingParams,
          target: SCRAPER_API_TARGETS.YOUTUBE_SUBTITLES,
        } satisfies ScraperAPIParams;
    
        const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(data),
            },
          ],
        };
      }
    );
  • Registration of the youtube_subtitles tool with input schema (query string for video ID, optional language_code) and annotations.
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'youtube_subtitles',
        {
          description: 'Scrape YouTube video subtitles',
          inputSchema: {
            query: z.string().describe('YouTube video ID (e.g., "L8zSWbQN-v8")'),
            language_code: zodLanguageCode,
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
  • Registration of YoutubeSubtitlesTool in the allTools array and subsequent registration via registerTools/registerAllTools.
    new YoutubeSubtitlesTool(),
    new YoutubeSearchTool(),
  • Constant defining the SCRAPER_API_TARGETS.YOUTUBE_SUBTITLES enum value used as the target parameter for the ScraperAPI call.
    YOUTUBE_SUBTITLES = 'youtube_subtitles',
Behavior3/5

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

The description 'scrape' implies a read operation, which aligns with the readOnlyHint annotation. However, it adds no additional behavioral details such as output format, pagination, or rate limits beyond what the annotations already convey. The openWorldHint is also not elaborated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, making it concise and to the point. It earns its place by clearly stating the tool's purpose, but it could potentially include more information without becoming verbose.

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 the tool has 2 parameters and no output schema, the description is adequate but not comprehensive. It lacks details on output structure, potential errors, or usage constraints, though annotations provide some context for read-only and open-world behavior.

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?

The input schema has 100% coverage with descriptions for both parameters ('query' and 'language_code'). The description itself does not add any further meaning or examples beyond the schema, so a baseline of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the verb 'scrape' and the resource 'YouTube video subtitles', making the tool's purpose straightforward. However, it does not differentiate from sibling tools like youtube_metadata or youtube_channel, which also deal with YouTube video content.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, typical use cases, or when not to use it, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/Decodo/mcp-server'

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