Skip to main content
Glama

removeCollection

Delete a local transcript collection and its search index to manage storage and organize YouTube intelligence data.

Instructions

Delete a local transcript collection and its search index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionIdYes

Implementation Reference

  • Handler logic to delete a collection from the database, clear its associated data (chunks/videos), and update the application state if the collection was active.
    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(),
      };
    }
  • Registration and dispatching of the "removeCommentCollection" tool in the MCP server request handler. Note that while searching for "removeCollection", the actual tool registered is "removeCommentCollection". Wait, the prompt asked for "removeCollection". Let me re-verify. Oh, looking at the tools list again, I see both "removeCollection" (index 335) and "removeCommentCollection" (index 649). They are different. Checking the registration for "removeCollection".
    case "removeCommentCollection":
      return service.removeCommentCollection({
        collectionId: readString(args, "collectionId"),
      });
  • Registration of the "removeCollection" tool handler in the MCP server.
    case "removeCollection":
      return service.removeCollection({
        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