Skip to main content
Glama

downloadAsset

Download YouTube videos, audio tracks, or thumbnails to local storage for offline access and file management.

Instructions

Download a YouTube video, audio track, or thumbnail to local storage. Returns asset manifest entry with file path. Does NOT perform visual indexing — this is honest file storage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
videoIdOrUrlYesYouTube video ID or URL
formatYesWhat to download. best_video = highest quality video+audio, best_audio = audio only, thumbnail = YouTube thumbnail image, worst_video = smallest video for previews
maxSizeMbNoMax download size in MB (default 500)

Implementation Reference

  • The handler implementation for the `downloadAsset` tool within `src/server/mcp-server.ts`. It utilizes `MediaDownloader` to perform the actual download.
    case "downloadAsset": {
      const mediaStore = getMediaStore();
      const mediaDownloader = getMediaDownloader();
      const videoIdOrUrl = readString(args, "videoIdOrUrl");
      const format = readString(args, "format") as "best_video" | "best_audio" | "thumbnail" | "worst_video";
      const maxSizeMb = optionalNumber(args, "maxSizeMb");
      const result = await mediaDownloader.download({ videoIdOrUrl, format, maxSizeMb });
      const provenance = { sourceTier: "yt_dlp" as const, fetchedAt: new Date().toISOString(), fallbackDepth: 0 as const, partial: false };
      return {
        asset: {
          assetId: result.asset.assetId,
          videoId: result.asset.videoId,
          kind: result.asset.kind,
          filePath: result.asset.filePath,
          fileName: result.asset.fileName,
          fileSizeBytes: result.asset.fileSizeBytes,
          mimeType: result.asset.mimeType,
          durationSec: result.asset.durationSec,
          width: result.asset.width,
          height: result.asset.height,
        },
        downloadedBytes: result.downloadedBytes,
        durationMs: result.durationMs,
        cached: result.downloadedBytes === 0,
        provenance,
      };
    }
  • The registration of the `downloadAsset` tool, including its name, description, and input schema.
    {
      name: "downloadAsset",
      description: "Download a YouTube video, audio track, or thumbnail to local storage. Returns asset manifest entry with file path. Does NOT perform visual indexing — this is honest file storage.",
      inputSchema: {
        type: "object",
        properties: {
          videoIdOrUrl: { type: "string", description: "YouTube video ID or URL" },
          format: {
            type: "string",
            enum: ["best_video", "best_audio", "thumbnail", "worst_video"],
            description: "What to download. best_video = highest quality video+audio, best_audio = audio only, thumbnail = YouTube thumbnail image, worst_video = smallest video for previews",
          },
          maxSizeMb: { type: "number", minimum: 1, maximum: 5000, description: "Max download size in MB (default 500)" },
        },
        required: ["videoIdOrUrl", "format"],
        additionalProperties: false,
      },
    },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it downloads files to local storage, returns an asset manifest entry with file path, and explicitly states it does not perform visual indexing. It could improve by mentioning potential rate limits, authentication needs, or file overwriting behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly front-loaded with the core purpose in the first sentence, followed by return value clarification and an important exclusion. Every sentence earns its place with zero wasted words, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a download tool with no annotations and no output schema, the description provides good coverage of what the tool does, what it returns, and what it doesn't do. It could be more complete by mentioning potential errors (e.g., invalid URLs, size limits) or the format of the returned manifest, but it's substantially adequate for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema. The baseline score of 3 is appropriate when the schema does the heavy lifting for parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Download a YouTube video, audio track, or thumbnail to local storage') and distinguishes it from siblings by explicitly stating what it does NOT do ('Does NOT perform visual indexing'). It identifies the resource (YouTube assets) and verb (download) with precision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (for downloading assets to local storage) and explicitly excludes visual indexing. However, it doesn't mention when to use alternatives like 'listMediaAssets' for viewing existing assets or 'removeMediaAsset' for deletion, nor does it specify prerequisites like needing storage space.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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