Skip to main content
Glama

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
NameRequiredDescriptionDefault
collectionIdYes

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(),
      };
    }
  • 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"),
      });

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