Skip to main content
Glama

search_youtube

Search YouTube videos using personalized browser cookies to find relevant content based on your query and preferences.

Instructions

Search YouTube for videos. Uses Chrome cookies for personalized results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
limitNoMax results (default 10)

Implementation Reference

  • The handler for the 'search_youtube' tool, which uses fetchFeed to query YouTube and formats the results.
    async ({ query, limit }) => {
      const depErr = checkDeps();
      if (depErr) return errorResult(depErr);
    
      try {
        const result = await fetchFeed(`https://www.youtube.com/results?search_query=${encodeURIComponent(query)}`, limit);
        const videos = (result.entries || []).map(pickVideoFields);
        return textResult({ query, count: videos.length, videos });
      } catch (err) {
        return errorResult(`Error searching: ${err instanceof Error ? err.message : String(err)}`);
      }
    }
  • src/index.ts:197-203 (registration)
    Registration of the 'search_youtube' tool with its schema definition using Zod.
    server.tool(
      'search_youtube',
      'Search YouTube for videos. Uses Chrome cookies for personalized results.',
      {
        query: z.string().describe('Search query'),
        limit: z.number().min(1).max(30).default(10).describe('Max results (default 10)'),
      },
Behavior3/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. It successfully adds critical context that 'Uses Chrome cookies for personalized results', indicating state dependency and personalization behavior. However, it lacks disclosure about what the tool returns (video metadata structure), pagination behavior, or any rate limiting.

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 consists of exactly two sentences with zero waste. The first sentence front-loads the core purpose ('Search YouTube for videos'), while the second adds essential behavioral context about cookies. Every word earns its place.

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?

For a two-parameter search tool without output schema, the description adequately covers the core function but leaves gaps. It fails to describe the return value structure (what fields are returned for each video), which is particularly important given the absence of an output schema to document the response format.

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?

With 100% schema description coverage, the input schema already documents both parameters (query and limit) including types, constraints, and defaults. The description adds no additional parameter semantics, examples, or usage patterns beyond what the schema provides, warranting the baseline score.

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 specific verb 'Search' and resource 'YouTube videos', providing immediate clarity on the tool's function. However, it does not explicitly differentiate from sibling retrieval tools like get_youtube_feed or get_channel_videos, leaving implicit the distinction between searching and browsing.

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 does not clarify when to search versus using get_youtube_feed for recommended content, or how this differs from get_channel_videos for specific channel content.

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/ronantakizawa/social-video-mcp'

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