Skip to main content
Glama

removeMediaAsset

Delete stored media assets from the vidlens-mcp server. Remove specific assets by ID or clear all assets for a video to manage storage.

Instructions

Remove stored media assets. Specify assetId to remove one, or videoIdOrUrl to remove all assets for a video.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetIdNoSpecific asset ID to remove
videoIdOrUrlNoRemove all assets for this video
deleteFilesNoAlso delete files from disk (default true)

Implementation Reference

  • The handler for "removeMediaAsset" in src/server/mcp-server.ts uses MediaStore to remove assets by ID or video ID.
    case "removeMediaAsset": {
      const mediaStore = getMediaStore();
      const assetId = optionalString(args, "assetId");
      const videoIdOrUrl = optionalString(args, "videoIdOrUrl");
      const deleteFiles = readBoolean(args, "deleteFiles", true);
    
      if (!assetId && !videoIdOrUrl) {
        throw new Error("Provide either assetId or videoIdOrUrl to specify what to remove");
      }
    
      let removed = 0;
      let freedBytes = 0;
    
      if (assetId) {
        const asset = mediaStore.getAsset(assetId);
        if (asset) {
          freedBytes = asset.fileSizeBytes;
          mediaStore.removeAsset(assetId, deleteFiles);
          removed = 1;
        }
      } else if (videoIdOrUrl) {
        const videoId = parseVideoId(videoIdOrUrl) ?? videoIdOrUrl;
        const assets = mediaStore.listAssetsForVideo(videoId);
        freedBytes = assets.reduce((sum, a) => sum + a.fileSizeBytes, 0);
        removed = mediaStore.removeVideoAssets(videoId, deleteFiles);
      }
    
      const provenance = { sourceTier: "none" as const, fetchedAt: new Date().toISOString(), fallbackDepth: 0 as const, partial: false };
      return { removed, freedBytes, provenance };
    }
  • Registration of the "removeMediaAsset" tool including its input schema.
      name: "removeMediaAsset",
      description: "Remove stored media assets. Specify assetId to remove one, or videoIdOrUrl to remove all assets for a video.",
      inputSchema: {
        type: "object",
        properties: {
          assetId: { type: "string", description: "Specific asset ID to remove" },
          videoIdOrUrl: { type: "string", description: "Remove all assets for this video" },
          deleteFiles: { type: "boolean", description: "Also delete files from disk (default true)" },
        },
        additionalProperties: false,
      },
    },

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