Skip to main content
Glama

findConsistentOutlierChannels

Read-onlyIdempotent

Discover emerging YouTube channels that consistently outperform their size in a specific topic.

Instructions

A powerful, high-cost discovery tool. It finds emerging channels that show consistent, high-performance relative to their size within a specific topic and timeframe.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesRequired. The core topic or niche to investigate (e.g., 'stoic philosophy', 'AI history explainers').
channelAgeNoOptional. Filters by channel age. Default: 'NEW'. 'NEW' = under 6 months (emerging), 'ESTABLISHED' = 6-24 months (proven).NEW
consistencyLevelNoOptional. Minimum required consistency. Default: 'MODERATE'. 'MODERATE' (~30%) for broad discovery. 'HIGH' (~50%) for exceptional channels.MODERATE
outlierMagnitudeNoOptional. Required 'viral factor' for videos. Default: 'STANDARD'. 'STANDARD' (views>subs) for regular content. 'STRONG' (views>3x subs) for viral channels.STANDARD
videoCategoryIdNoOptional. YouTube video category ID to narrow search (e.g., '27' for Education). Improves relevance.
regionCodeNoOptional. ISO 2-letter country code (e.g., 'US', 'DE') to target a regional audience.
maxResultsNoOptional. Max number of channels to return. Default: 10.

Implementation Reference

  • The FindConsistentOutlierChannelsTool class with executeImpl() method - the primary handler that validates params via Zod schema, creates NicheRepository and NicheAnalyzerService instances, then calls nicheAnalyzer.findConsistentOutlierChannels() and formats the result.
    export class FindConsistentOutlierChannelsTool extends BaseTool<
      typeof findConsistentOutlierChannelsSchema
    > {
      name = "findConsistentOutlierChannels";
      description =
        "A powerful, high-cost discovery tool. It finds emerging channels that show consistent, high-performance relative to their size within a specific topic and timeframe.";
      schema = findConsistentOutlierChannelsSchema;
    
      protected async executeImpl(
        params: z.infer<typeof findConsistentOutlierChannelsSchema>
      ): Promise<CallToolResult> {
        // --- THIS IS THE EXPLICIT CONVERSION POINT ---
        // We use Zod to parse the user's flexible input.
        // The result of `parse` is a new, complete object with all defaults applied.
        // This new object perfectly matches the strict `...Options` type.
        const validatedOptions: FindConsistentOutlierChannelsOptions = params;
    
        // Now, we create our services and pass them the strict, validated options.
        const nicheRepository = new NicheRepository();
        const nicheAnalyzer = new NicheAnalyzerService(
          this.container.youtubeService,
          nicheRepository
        );
    
        // The analyzer's method is called with the guaranteed, complete options object.
        const searchResults =
          await nicheAnalyzer.findConsistentOutlierChannels(validatedOptions);
    
        return formatSuccess(searchResults);
      }
    }
  • Zod schema (findConsistentOutlierChannelsSchema) defining the tool's input parameters: query (required string), channelAge (default NEW), consistencyLevel (default MODERATE), outlierMagnitude (default STANDARD), videoCategoryId (optional), regionCode (optional), maxResults (default 10, max 50).
    export const findConsistentOutlierChannelsSchema = z.object({
      query: z
        .string()
        .min(1, "Query is required")
        .describe(
          "Required. The core topic or niche to investigate (e.g., 'stoic philosophy', 'AI history explainers')."
        ),
      channelAge: z
        .enum(["NEW", "ESTABLISHED"])
        .default("NEW")
        .describe(
          "Optional. Filters by channel age. Default: 'NEW'. 'NEW' = under 6 months (emerging), 'ESTABLISHED' = 6-24 months (proven)."
        ),
      consistencyLevel: z
        .enum(["MODERATE", "HIGH"])
        .default("MODERATE")
        .describe(
          "Optional. Minimum required consistency. Default: 'MODERATE'. 'MODERATE' (~30%) for broad discovery. 'HIGH' (~50%) for exceptional channels."
        ),
      outlierMagnitude: z
        .enum(["STANDARD", "STRONG"])
        .default("STANDARD")
        .describe(
          "Optional. Required 'viral factor' for videos. Default: 'STANDARD'. 'STANDARD' (views>subs) for regular content. 'STRONG' (views>3x subs) for viral channels."
        ),
      videoCategoryId: z
        .string()
        .optional()
        .describe(
          "Optional. YouTube video category ID to narrow search (e.g., '27' for Education). Improves relevance."
        ),
      regionCode: regionCodeSchema
        .optional()
        .describe(
          "Optional. ISO 2-letter country code (e.g., 'US', 'DE') to target a regional audience."
        ),
      maxResults: z
        .number()
        .int()
        .min(1)
        .max(50)
        .default(10)
        .describe("Optional. Max number of channels to return. Default: 10."),
    });
  • TypeScript interface FindConsistentOutlierChannelsOptions used by the service layer - the strict type that params are cast to after Zod parsing.
    export interface FindConsistentOutlierChannelsOptions {
      query: string;
      channelAge: "NEW" | "ESTABLISHED";
      consistencyLevel: "MODERATE" | "HIGH";
      outlierMagnitude: "STANDARD" | "STRONG";
      videoCategoryId?: string;
      regionCode?: string;
      maxResults: number;
    }
  • FindConsistentOutlierChannelsParams interface - an alternative param type definition with optional fields for the tool input.
    export interface FindConsistentOutlierChannelsParams {
      query: string;
      channelAge?: "NEW" | "ESTABLISHED";
      consistencyLevel?: "MODERATE" | "HIGH";
      outlierMagnitude?: "STANDARD" | "STRONG";
      videoCategoryId?: string;
      regionCode?: string;
      maxResults?: number;
    }
  • Registration in registerTools() - the tool is imported at line 16, added to toolsToRegister at line 49 (only when MDB_MCP_CONNECTION_STRING is set), and registered with the MCP server via server.registerTool() at line 65.
    export function registerTools(server: McpServer, container: IServiceContainer) {
      const hasYoutubeKey = !!process.env.YOUTUBE_API_KEY;
      const toolsToRegister: ToolConstructor[] = [];
    
      if (hasYoutubeKey) {
        // Register all standard YouTube tools
        toolsToRegister.push(...(TOOL_CLASSES as ToolConstructor[]));
    
        // Register analytics tools if connection string is present
        if (process.env.MDB_MCP_CONNECTION_STRING) {
          toolsToRegister.push(FindConsistentOutlierChannelsTool);
        }
      } else {
        // Only register tools that don't require the API key
        toolsToRegister.push(GetTranscriptsTool);
      }
    
      for (const ToolClass of toolsToRegister) {
        // Instantiate with DI container
        const toolInstance = new ToolClass(container);
    
        const humanReadableTitle = toolInstance.name
          .replace(/([A-Z])/g, " $1")
          .replace(/^./, (str: string) => str.toUpperCase());
    
        // Register with MCP Server
        server.registerTool(
          toolInstance.name,
          {
            description: toolInstance.description,
            inputSchema: toolInstance.schema,
            annotations: {
              title: humanReadableTitle,
              readOnlyHint: true,
              idempotentHint: true,
            },
          },
          // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
          (async (
            args: z.infer<typeof toolInstance.schema>
          ): Promise<CallToolResult> => {
            try {
              return await toolInstance.execute(args);
            } catch (err) {
              return formatError(err);
            }
            // eslint-disable-next-line @typescript-eslint/no-explicit-any
          }) as any
        );
      }
    }
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is clear. The description adds behavioral context by labeling it 'high-cost,' which is valuable for agent decision-making. No contradiction with annotations.

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 two well-structured sentences. It front-loads the 'high-cost' warning and then states the core function, with no unnecessary words. Every sentence earns its place.

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 7 parameters (all thoroughly described in schema) and annotations, the description covers the purpose and cost implication. It lacks explicit mention of output structure, but the parameter details compensate. Overall, it is sufficiently informative for a discovery tool.

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 coverage is 100%, so each parameter already has a description. The tool description itself does not add further parameter semantics beyond what the schema provides, so baseline score of 3 is appropriate.

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 tool finds emerging channels with consistent high performance relative to size, which is a specific verb-resource combination. It differentiates from sibling tools like getChannelStatistics and getChannelTopVideos by focusing on discovery of outliers rather than simple stats or top videos.

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

Usage Guidelines3/5

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

The description calls it a 'high-cost discovery tool,' hinting at when to use it (discovery) but does not explicitly state when not to use it or provide alternatives among siblings. The cost warning is helpful but incomplete guidance.

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/kirbah/mcp-youtube'

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