Skip to main content
Glama
Decodo

Decodo MCP Server

youtube_metadata

Read-only

Retrieve YouTube video metadata by providing a video ID. Extracts details like title, description, and more for analysis or integration.

Instructions

Scrape YouTube video metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesYouTube video ID (e.g., "dFu9aKJoqGg")

Implementation Reference

  • The YoutubeMetadataTool class containing the register method which defines the tool handler. The handler accepts a YouTube video ID, wraps it with the SCRAPER_API_TARGETS.YOUTUBE_METADATA target, calls sapiClient.scrape(), and returns the scraped data as JSON text.
    export class YoutubeMetadataTool extends Tool {
      toolset = TOOLSET.SOCIAL_MEDIA;
    
      transformResponse = ({ data }: { data: object }) => {
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'youtube_metadata',
          {
            description: 'Scrape YouTube video metadata',
            inputSchema: {
              query: z.string().describe('YouTube video ID (e.g., "dFu9aKJoqGg")'),
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.YOUTUBE_METADATA,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(data),
                },
              ],
            };
          }
        );
      };
    }
  • Input schema using Zod: expects a single 'query' string parameter (a YouTube video ID like 'dFu9aKJoqGg').
    inputSchema: {
      query: z.string().describe('YouTube video ID (e.g., "dFu9aKJoqGg")'),
    },
  • The register method that calls server.registerTool('youtube_metadata', ...) to register the tool with the MCP server.
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'youtube_metadata',
        {
          description: 'Scrape YouTube video metadata',
          inputSchema: {
            query: z.string().describe('YouTube video ID (e.g., "dFu9aKJoqGg")'),
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
        async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
          const params = {
            ...scrapingParams,
            target: SCRAPER_API_TARGETS.YOUTUBE_METADATA,
          } satisfies ScraperAPIParams;
    
          const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(data),
              },
            ],
          };
        }
      );
  • The YoutubeMetadataTool is imported and instantiated as part of the static allTools array (line 87) in ScraperAPIBaseServer, which registers it on server startup.
      YoutubeMetadataTool,
      YoutubeChannelTool,
      YoutubeSubtitlesTool,
      YoutubeSearchTool,
      ScrapeAsMarkdownTool,
      ScreenshotTool,
    } from '../tools';
    import { Tool } from '../tools/tool';
    import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
    import { TOOLSET } from '../constants';
    
    export class ScraperAPIBaseServer {
      server: McpServer;
    
      sapiClient: ScraperApiClient;
    
      auth: string = '';
    
      constructor({ auth, toolsets = [] }: { auth: string; toolsets: TOOLSET[] }) {
        this.server = new McpServer({
          name: 'decodo',
          version: PACKAGE_VERSION,
        });
        this.sapiClient = new ScraperApiClient({});
    
        this.auth = auth;
    
        this.registerTools({ toolsets });
    
        this.registerResources();
      }
    
      connect(transport: StdioServerTransport | StreamableHTTPServerTransport) {
        this.server.connect(transport);
      }
    
      static allTools: Tool[] = [
        new ScrapeAsMarkdownTool(),
        new ScreenshotTool(),
        new GoogleSearchTool(),
        new GoogleAdsTool(),
        new GoogleLensTool(),
        new GoogleAiModeTool(),
        new GoogleTravelHotelsTool(),
        new AmazonSearchTool(),
        new AmazonProductTool(),
        new AmazonPricingTool(),
        new AmazonSellersTool(),
        new AmazonBestsellersTool(),
        new WalmartSearchTool(),
        new WalmartProductTool(),
        new TargetSearchTool(),
        new TargetProductTool(),
        new TiktokPostTool(),
        new TiktokShopSearchTool(),
        new TiktokShopProductTool(),
        new TiktokShopUrlTool(),
        new YoutubeMetadataTool(),
  • Defines the SCRAPER_API_TARGETS.YOUTUBE_METADATA constant with value 'youtube_metadata', used by the tool to set the scraping target.
    YOUTUBE_METADATA = 'youtube_metadata',
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true. Description adds only 'Scrape', which aligns with read-only. No additional traits like rate limits, required auth, or response format are disclosed.

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?

A single, concise sentence with no fluff. Front-loads the main action. Could be improved by adding structure (e.g., bullet points or more detail) without sacrificing conciseness.

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

Completeness2/5

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

The description is too minimal for a tool with no output schema and a potentially confusing parameter. It does not explain what kind of metadata is returned, how to interpret results, or handle errors. The agent is left with many unknowns.

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

Parameters2/5

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

Schema coverage is 100%, so the description has low burden. However, it adds no extra meaning beyond the schema. The parameter name 'query' is misleading (actually a video ID), but the schema description clarifies it. The tool description does not address this mismatch.

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?

Description clearly states the action (scrape) and resource (YouTube video metadata). However, it does not specify what metadata fields are included, and the tool name alone already conveys the purpose. Lacks differentiation from siblings like youtube_search or youtube_channel.

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

Usage Guidelines1/5

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

No mention of when to use this tool over alternatives such as youtube_search or youtube_subtitles. Provides no context or exclusions, leaving the agent with no guidance on 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