Skip to main content
Glama

listMediaAssets

Retrieve locally stored media assets from YouTube intelligence data. Filter by video ID or asset type to view file paths, sizes, and metadata.

Instructions

List locally stored media assets. Filter by video or kind. Shows file paths, sizes, and manifest metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
videoIdOrUrlNoFilter to assets for this video
kindNoFilter by asset kind
limitNo

Implementation Reference

  • Implementation of the 'listMediaAssets' tool handler, which uses the MediaStore to query and return assets based on optional videoId or kind filters.
    case "listMediaAssets": {
      const mediaStore = getMediaStore();
      const videoIdOrUrl = optionalString(args, "videoIdOrUrl");
      const kind = optionalString(args, "kind") as "video" | "audio" | "thumbnail" | "keyframe" | undefined;
      const limit = optionalNumber(args, "limit");
    
      let assets;
      if (videoIdOrUrl) {
        const videoId = parseVideoId(videoIdOrUrl) ?? videoIdOrUrl;
        assets = mediaStore.listAssetsForVideo(videoId);
        if (kind) assets = assets.filter((a) => a.kind === kind);
        if (limit) assets = assets.slice(0, limit);
      } else {
        assets = mediaStore.listAllAssets({ kind: kind as any, limit });
      }
    
      const stats = mediaStore.getStats();
      const provenance = { sourceTier: "none" as const, fetchedAt: new Date().toISOString(), fallbackDepth: 0 as const, partial: false };
      return {
        assets: assets.map((a) => ({
          assetId: a.assetId,
          videoId: a.videoId,
          kind: a.kind,
          filePath: a.filePath,
          fileName: a.fileName,
          fileSizeBytes: a.fileSizeBytes,
          mimeType: a.mimeType,
          timestampSec: a.timestampSec,
          width: a.width,
          height: a.height,
          durationSec: a.durationSec,
          createdAt: a.createdAt,
        })),
        stats: {
          totalAssets: stats.totalAssets,
          totalSizeBytes: stats.totalSizeBytes,
          videoCount: stats.videoCount,
          byKind: stats.byKind,
        },
        provenance,
      };
    }
  • Definition of the 'listMediaAssets' tool schema, including input validation parameters such as videoIdOrUrl, kind, and limit.
      name: "listMediaAssets",
      description: "List locally stored media assets. Filter by video or kind. Shows file paths, sizes, and manifest metadata.",
      inputSchema: {
        type: "object",
        properties: {
          videoIdOrUrl: { type: "string", description: "Filter to assets for this video" },
          kind: { type: "string", enum: ["video", "audio", "thumbnail", "keyframe"], description: "Filter by asset kind" },
          limit: { type: "number", minimum: 1, maximum: 500 },
        },
        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