Skip to main content
Glama
Decodo

Decodo MCP Server

youtube_search

Read-only

Search YouTube videos by keyword. Returns metadata including title, URL, and description for each result.

Instructions

Search YouTube videos

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesYouTube search query (e.g., "How to care for chinchillas")

Implementation Reference

  • The YoutubeSearchTool class that contains both the definition and the handler logic for the 'youtube_search' tool. It registers the tool with a 'query' input schema, sets the target to SCRAPER_API_TARGETS.YOUTUBE_SEARCH, and calls sapiClient.scrape to execute the search.
    export class YoutubeSearchTool extends Tool {
      toolset = TOOLSET.SOCIAL_MEDIA;
    
      transformResponse = ({ data }: { data: object }) => {
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'youtube_search',
          {
            description: 'Search YouTube videos',
            inputSchema: {
              query: z.string().describe('YouTube search query (e.g., "How to care for chinchillas")'),
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.YOUTUBE_SEARCH,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(data),
                },
              ],
            };
          }
        );
      };
    }
  • Input schema definition for youtube_search: requires a 'query' string parameter describing the YouTube search query.
      description: 'Search YouTube videos',
      inputSchema: {
        query: z.string().describe('YouTube search query (e.g., "How to care for chinchillas")'),
      },
      annotations: {
        readOnlyHint: true,
        openWorldHint: true,
      },
    },
  • Registration of the tool with the MCP server via server.registerTool('youtube_search', ...).
    server.registerTool(
      'youtube_search',
      {
        description: 'Search YouTube videos',
        inputSchema: {
          query: z.string().describe('YouTube search query (e.g., "How to care for chinchillas")'),
        },
        annotations: {
          readOnlyHint: true,
          openWorldHint: true,
        },
      },
      async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
        const params = {
          ...scrapingParams,
          target: SCRAPER_API_TARGETS.YOUTUBE_SEARCH,
        } satisfies ScraperAPIParams;
    
        const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(data),
            },
          ],
        };
      }
    );
  • Instantiation of YoutubeSearchTool in the allTools static array, making it available for registration on the server.
    new YoutubeSearchTool(),
  • Definition of the SCRAPER_API_TARGETS.YOUTUBE_SEARCH constant used as the target identifier for the YouTube search API call.
    YOUTUBE_SEARCH = 'youtube_search',
Behavior3/5

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

Annotations already indicate it's read-only (readOnlyHint=true) and open-ended (openWorldHint=true). The description adds no further behavioral context such as rate limits, result count limits, or pagination.

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 concise sentence that wastes no words. It is appropriately sized for the tool's simplicity.

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?

The tool has one parameter and no output schema. The description is minimal and does not explain what is returned (e.g., list of videos, metadata). Given sibling tools, more context would help.

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 describes the 'query' parameter well with an example, achieving 100% coverage. The description does not add meaning beyond what the schema already provides.

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 it searches YouTube videos, which is a specific verb+resource. However, it does not differentiate from sibling tools like youtube_metadata or youtube_channel, which could be ambiguous.

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 on when to use this tool versus alternatives (e.g., bing_search or google_search for broader searches, or youtube_metadata for specific video details). No exclusions or prerequisites are mentioned.

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