Skip to main content
Glama

listCommentCollections

Lists local comment collections with search focus and indexed counts to organize YouTube comment analysis for AI agents.

Instructions

List local comment collections, active search focus, and indexed comment counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeVideoListNo

Implementation Reference

  • The `listCollections` method in `CommentKnowledgeBase` class fetches all comment collections from the database, including optional video lists, and maps them to the expected output format. This is the implementation for the `listCommentCollections` tool.
    listCollections(
      includeVideoList = false,
    ): ListCommentCollectionsOutput {
      const rows = this.db
        .prepare(
          `SELECT
             c.collection_id,
             c.label,
             c.created_at,
             c.updated_at,
             COALESCE((SELECT COUNT(*) FROM comment_collection_videos v WHERE v.collection_id = c.collection_id), 0) AS video_count,
             COALESCE((SELECT COUNT(*) FROM comment_chunks ch WHERE ch.collection_id = c.collection_id), 0) AS total_chunks
           FROM comment_collections c
           ORDER BY c.updated_at DESC, c.collection_id ASC`,
        )
        .all() as Array<{
        collection_id: string;
        label: string | null;
        created_at: string;
        updated_at: string;
        video_count: number;
        total_chunks: number;
      }>;
    
      const activeCollectionId = this.getActiveCollectionId();
      const videoMap = includeVideoList
        ? this.loadVideosForCollections(rows.map((r) => r.collection_id))
        : new Map<string, CommentCollectionSummary["videos"]>();
    
      return {
        collections: rows.map((row) => ({
          collectionId: row.collection_id,
          label: row.label ?? undefined,
          videoCount: Number(row.video_count ?? 0),
          totalCommentChunks: Number(row.total_chunks ?? 0),
          createdAt: row.created_at,
          lastUpdatedAt: row.updated_at,
          isActive: row.collection_id === activeCollectionId,
          videos: videoMap.get(row.collection_id),
        })),
        activeCollectionId: activeCollectionId ?? undefined,
        provenance: localProvenance(),
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool lists data but doesn't specify whether this is a read-only operation, if it requires authentication, what the output format is, or any rate limits. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 that front-loads the key information without any unnecessary words. It directly communicates the tool's purpose in a clear and structured manner, 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 lack of annotations, no output schema, and low schema description coverage, the description is incomplete. It doesn't provide enough context about the tool's behavior, output, or parameters to fully guide an AI agent, especially compared to sibling tools that might have overlapping functionalities.

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 has one parameter with 0% description coverage, and the tool description does not mention or explain the parameter 'includeVideoList'. Since the schema coverage is low, the description should compensate but fails to do so. However, with only one parameter, the baseline is slightly higher, but the lack of any parameter explanation keeps it at an average 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 tool's purpose with specific verbs ('List') and resources ('local comment collections, active search focus, and indexed comment counts'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this tool from sibling tools like 'listCollections' or 'listChannelCatalog', which prevents a perfect score.

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 like 'listCollections' or 'searchComments', nor does it mention any prerequisites or context for usage. It merely states what the tool does without indicating appropriate scenarios or exclusions.

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/rajanrengasamy/vidlens-mcp'

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