Skip to main content
Glama

stagenth · file-relay

download_file

下载一个文件, 按 MCP spec 2025-06-18 的原生 content 类型返回。

    根据文件 category 自动选择最合适的 MCP content block 类型:
    - image (jpg/png/webp/...)  → content[0].type = "image"
      (base64 + mimeType; AI 客户端原生显示图片, 多模态 LLM 可直接看图)
    - audio (mp3/wav/...)       → content[0].type = "audio"
      (base64 + mimeType; AI 客户端原生播放, 多模态模型可直接听)
    - text/code + as_text=true  → content[0].type = "text"
      (UTF-8 字符串; 适合代码/文档阅读分析)
    - 其他所有 (video / document / archive / 大文本 / ...)
                                → content[0].type = "resource_link"
      (15 分钟有效的 URL + mimeType + size; 签名自带, 无需 Authorization;
       AI 用 bash curl 拉字节, 或提示用户点链接在浏览器下载)

    【限速】所有分支都遵守会员档位的 download_speed_bytes_per_sec 设定:
      - image / audio / text 分支走 astream_file(throttle=...) 读字节再 base64
      - resource_link 分支: 链接指向 /api/v1/mcp-download/{token}, 目标路由
        也用同一套 astream_file + throttle 算法 (详见 api/v1/mcp_download.py)

    【零副作用】不再使用 share_service.create_share —— MCP 下载不会在你的
    账号里留下任何公开分享记录, 不进分享面板, 不计分享审计。
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_textNo【仅文本/代码文件】直接返 UTF-8 字符串文本内容。图片/音频等非文本文件不受此参数影响(它们按 MCP 原生 content type 返回)。
file_idNo
file_uuidNo

TDQS

A3.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses content-type selection logic, rate-limiting behavior via astream_file/throttle, 15-minute URL validity, no Authorization header needed for resource links, and zero side effects (no share creation, no audit records). This is rich behavioral transparency beyond basic operation.

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

Conciseness4/5

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

The description is longer than average but well-organized with bullet points and sections. The first sentence states the main purpose, and the following details on content types, rate limiting, and side effects are each valuable. Some redundancy exists (e.g., repeating 'astream_file' details), but overall it is appropriately sized for the tool's complexity.

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

Completeness3/5

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

No output schema and no annotations increase the burden on the description. It covers return types, rate limiting, and side effects well, but it omits essential parameter semantics (file_id/file_uuid requirements) and error handling. The tool is complex (3 params, multiple return types), yet the description leaves a notable gap in how to specify the target file, making it incomplete for an agent.

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

Parameters2/5

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

Schema coverage is only 33% (as_text has a description). The description explains as_text behavior but says nothing about file_id or file_uuid—how to specify which file to download, their relationship, or which is required. With low schema coverage, the description should compensate, but it does not address these key parameters.

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?

Description clearly states the tool downloads a file and returns it as native MCP content types, with specific branching for image, audio, text, and other types. This specific verb+resource+behavior distinguishes it from siblings like download_shared_file and file_read.

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

Usage Guidelines3/5

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

The description implies usage by explaining which content block is chosen for different file categories, but it does not explicitly state when to use this tool versus alternatives (e.g., file_read for text, download_shared_file for shared links). No exclusions or alternative references are given, so guidance is only implied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.6/5.0
Disambiguation4/5

Tools are largely distinct with clear purposes. Some potential confusion exists between upload_file (a convenience wrapper) and the upload_init/chunk/complete sequence, but descriptions help clarify. The inclusion of scrape_url feels out of place but is also distinct.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (e.g., create_folder, delete_file, download_file). However, 'file_read' breaks the pattern (should be read_file), and 'get_file_info' uses get_ while others use list_. Overall minor inconsistency.

Tool Count4/5

With 25 tools, the count is slightly high but still reasonable for a file management server that includes upload, download, sharing, and folder operations. A few tools (like scrape_url) seem tangential, but overall the scope justifies the count.

Completeness4/5

The tool surface covers most core file and folder operations (create, read, update/move, delete, list, search, upload, download, share, zip). Notable gaps include no rename_file tool and no ability to update file metadata. Still, the set is fairly complete for basic file management.

Resources