Skip to main content
Glama

search_channel_videos

Read-only

Search YouTube videos within a specific channel by query. Input channel and search terms to retrieve matching videos from that channel. Ideal for locating a particular video based on topic or title.

Instructions

Search for specific videos within a single YouTube channel. Restricts results to the given channel. Use after resolve_channel if starting from a handle. Useful for 'find Karpathy's video about backpropagation' style queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYes@handle, channel URL, or UC... channel ID.
qYesSearch query (matched against video title and description within the channel).
limitNoMax results (1-50, default 30).

Implementation Reference

  • src/index.js:245-271 (registration)
    The tool 'search_channel_videos' is registered in the TOOLS array (line 246) with its name, description, annotations, and inputSchema. It requires 'channel' and 'q' parameters, with an optional 'limit' (1-50). The actual handler logic is delegated via the generic callUpstream() proxy to the upstream SubDownload API.
    {
      name: "search_channel_videos",
      description:
        "Search for specific videos within a single YouTube channel. Restricts results to the given channel. Use after resolve_channel if starting from a handle. Useful for 'find Karpathy's video about backpropagation' style queries.",
      annotations: { title: "Search Channel Videos", ...ANN.YT_READ },
      inputSchema: {
        type: "object",
        properties: {
          channel: {
            type: "string",
            description: "@handle, channel URL, or UC... channel ID.",
            minLength: 1,
          },
          q: {
            type: "string",
            description: "Search query (matched against video title and description within the channel).",
            minLength: 1,
          },
          limit: {
            type: "number",
            description: "Max results (1-50, default 30).",
            minimum: 1,
            maximum: 50,
          },
        },
        required: ["channel", "q"],
      },
  • Generic CallToolRequestSchema handler: all tools (including search_channel_videos) are forwarded to the upstream MCP server via callUpstream(), which sends a JSON-RPC tools/call request to the SubDownload API.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await callUpstream(
          request.params.name,
          request.params.arguments || {}
        );
      } catch (err) {
        return {
          content: [{ type: "text", text: err.message || String(err) }],
          isError: true,
        };
      }
    });
  • The callUpstream() helper function that proxies all tool calls (including search_channel_videos) to the upstream SubDownload MCP endpoint with the Bearer token.
    async function callUpstream(name, args) {
      if (!API_KEY) {
        throw new Error(
          "SUBDOWNLOAD_API_KEY env var is not set. Get one at https://subdownload.com/account, then run with -e SUBDOWNLOAD_API_KEY=<your-key>."
        );
      }
      const res = await fetch(UPSTREAM_URL, {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Accept: "application/json, text/event-stream",
          Authorization: `Bearer ${API_KEY}`,
        },
        body: JSON.stringify({
          jsonrpc: "2.0",
          id: Date.now(),
          method: "tools/call",
          params: { name, arguments: args },
        }),
      });
      const text = await res.text();
      let body;
      try {
        body = JSON.parse(text);
      } catch {
        throw new Error(
          `Upstream returned non-JSON response (HTTP ${res.status}): ${text.slice(0, 200)}`
        );
      }
      if (body.error) {
        throw new Error(body.error.message || JSON.stringify(body.error));
      }
      return body.result;
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description's addition is minimal—it adds the channel restriction. No contradictions, but it doesn't disclose other behavioral aspects like rate limits or result ordering.

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?

Three concise sentences: one for purpose, one for constraint, one for usage hint. Every sentence adds value without repetition or fluff.

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

Completeness4/5

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

Given the tool's moderate complexity, the description covers the essential points: purpose, scope (channel-restricted), and a practical usage tip. No output schema, but the search behavior is standard. Could mention result ordering or pagination, but not strictly required.

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 description does not need to compensate much. It adds a slight nuance by mentioning 'restricts results to the given channel' for the channel parameter, but does not provide new semantics beyond the schema.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Search for specific videos within a single YouTube channel.' It uses a specific verb and resource, and differentiates from siblings by emphasizing channel restriction and referencing general search in the use case.

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

Usage Guidelines4/5

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

Provides clear context on when to use: 'Use after resolve_channel if starting from a handle.' It also implicitly guides against using for general search via the 'restricts results to the given channel' phrasing. No explicit exclusions but sufficient for most scenarios.

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/SubDownload/subdownload-mcp'

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