setActiveCommentCollection
Set the default YouTube comment collection for focused searches when no specific collection is provided, streamlining comment analysis workflows.
Instructions
Set the default comment collection that searchComments should focus on when collectionId is omitted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | Yes |
Implementation Reference
- The `setActiveCollection` method in `CommentKnowledgeBase` handles the logic for setting the active comment collection ID in the database state and returning the collection summary. Note: In the codebase, this is named `setActiveCollection`, which corresponds to the tool `setActiveCommentCollection` registered in `src/server/mcp-server.ts`.
setActiveCollection( collectionId: string, ): SetActiveCommentCollectionOutput { const exists = this.db .prepare( "SELECT 1 FROM comment_collections WHERE collection_id = ?", ) .get(collectionId); if (!exists) throw new Error(`Comment collection not found: ${collectionId}`); this.setAppState("active_comment_collection_id", collectionId); const summary = this.getCollectionSummary(collectionId); return { activeCollectionId: collectionId, collection: summary ?? undefined, provenance: localProvenance(), }; }