removeCommentCollection
Delete a YouTube comment collection and its search index from the vidlens-mcp server to manage stored data.
Instructions
Delete a local comment collection and its search index.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | Yes |
Implementation Reference
- The handler function `removeCollection` in `CommentKnowledgeBase` handles the removal of comment collections from the database.
removeCollection(collectionId: string): RemoveCommentCollectionOutput { const existing = this.db .prepare( "SELECT 1 FROM comment_collections WHERE collection_id = ?", ) .get(collectionId); if (!existing) { return { removed: false, collectionId, chunksDeleted: 0, videosDeleted: 0, clearedActiveCollection: false, provenance: localProvenance(), }; } const chunkRow = this.db .prepare( "SELECT COUNT(*) AS count FROM comment_chunks WHERE collection_id = ?", ) .get(collectionId) as { count: number } | undefined; const videoRow = this.db .prepare( "SELECT COUNT(*) AS count FROM comment_collection_videos WHERE collection_id = ?", ) .get(collectionId) as { count: number } | undefined; const wasActive = this.getActiveCollectionId() === collectionId; this.db .prepare("DELETE FROM comment_collections WHERE collection_id = ?") .run(collectionId); if (wasActive) { this.deleteAppState("active_comment_collection_id"); } return { removed: true, collectionId, chunksDeleted: Number(chunkRow?.count ?? 0), videosDeleted: Number(videoRow?.count ?? 0), clearedActiveCollection: wasActive, provenance: localProvenance(), }; } - src/server/mcp-server.ts:1101-1104 (handler)MCP tool registration/dispatch handler for "removeCommentCollection" in `mcp-server.ts`. Note: It calls `service.removeCommentCollection`, which is presumably an instance of `CommentKnowledgeBase`.
case "removeCommentCollection": return service.removeCommentCollection({ collectionId: readString(args, "collectionId"), });