Skip to main content
Glama

videos_searchVideos

Search YouTube videos by entering a query and specify the maximum number of results to retrieve, enabling efficient content discovery and information gathering.

Instructions

Search for videos on YouTube

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of results to return
queryYesSearch query

Implementation Reference

  • The core handler function that implements the videos_searchVideos tool by searching YouTube videos using the Google YouTube Data API v3 search.list endpoint.
    async searchVideos({ 
      query, 
      maxResults = 10 
    }: SearchParams): Promise<any[]> {
      try {
        this.initialize();
        
        const response = await this.youtube.search.list({
          part: ['snippet'],
          q: query,
          maxResults,
          type: ['video']
        });
        
        return response.data.items || [];
      } catch (error) {
        throw new Error(`Failed to search videos: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • src/server.ts:182-190 (registration)
    Dispatch handler in the CallToolRequest that routes the tool call to the videoService.searchVideos method.
    case 'videos_searchVideos': {
        const result = await videoService.searchVideos(args as unknown as SearchParams);
        return {
            content: [{
                type: 'text',
                text: JSON.stringify(result, null, 2)
            }]
        };
    }
  • src/server.ts:63-80 (registration)
    Tool registration definition in the ListTools response, specifying the tool name, description, and input schema.
    {
        name: 'videos_searchVideos',
        description: 'Search for videos on YouTube',
        inputSchema: {
            type: 'object',
            properties: {
                query: {
                    type: 'string',
                    description: 'Search query',
                },
                maxResults: {
                    type: 'number',
                    description: 'Maximum number of results to return',
                },
            },
            required: ['query'],
        },
    },
  • TypeScript type definition for the input parameters of the videos_searchVideos tool.
    export interface SearchParams {
      query: string;
      maxResults?: number;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't describe whether this is a read-only operation, how results are returned (e.g., pagination, sorting), rate limits, authentication needs, or what the response looks like. This leaves significant gaps for a search tool.

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, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple search tool, making it easy to parse quickly.

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?

Given the tool's complexity (search with parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain behavioral aspects like result handling or error conditions, leaving the agent with insufficient context to use the tool effectively beyond basic parameter passing.

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 description coverage is 100%, so the input schema already documents both parameters ('query' as search query and 'maxResults' as maximum results). The description doesn't add any meaningful context beyond this, such as query syntax examples or result format details, but meets the baseline for high schema coverage.

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 'Search for videos on YouTube' clearly states the verb (search) and resource (videos on YouTube), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'channels_listVideos' or 'videos_getVideo', which might also retrieve videos through different mechanisms.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this search-based approach is preferable over direct retrieval tools like 'videos_getVideo' or 'channels_listVideos', nor does it specify any prerequisites or exclusions for usage.

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

Related 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/ZubeidHendricks/youtube-mcp-server'

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