Skip to main content
Glama

fetch_media

Read-onlyIdempotent

Download a generated media file (video, frame) and return its bytes, base64-encoded, so the file can be saved or shown even though the media endpoint isn't publicly reachable with your MCP key.

THIS IS THE EXPENSIVE PATH — prefer `download_url` from the job result. Bytes returned
here travel as TEXT, and text is where context dies: a 480 KB audio stem is ~640 thousand
base64 characters, roughly 160 000 tokens, in ONE tool result. The same file behind
`download_url` costs about twenty. An inline image preview is cheap by comparison (it
travels as an image, ~450 tokens) — it is base64 in a text field that hurts.

Because of that this tool REFUSES big files by default and hands back a download link
instead. Pass force_bytes=True only when you genuinely need the bytes inside the
conversation and know what it costs.

path: the `download_path` / `first_frame_path` value from a job
result (e.g. "/v1/media/<id>.mp4"), or just the bare filename.
max_kb: size ceiling for an in-band answer (default 64 KB ≈ 21 000 tokens).

Returns {"filename", "media_type", "base64"}. The download is scoped to your own
account group — you can only fetch media your key produced. Note videos can be
several MB, so the base64 payload is large; fetch only when you actually need the
bytes (to save/display), not to check status (use check_job for that).

On storage: generated files are NOT deleted on a timer — there is no retention window
to race. Space is only ever reclaimed when the server's disk runs low, and then only
from files that were already downloaded through this call; a result nobody fetched is
never removed to make room. So fetching once and saving the bytes locally is the way to
keep something for good, and a file you never fetched stays available. A file that was
reclaimed answers 410 with the date, not a bare 404.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
max_kbNo
force_bytesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, but the description adds substantial behavioral context: the default refusal of large files, the fallback to a download link, the storage semantics (no retention window, files never deleted until disk pressure, reclaimed files return 410 not 404), and the token-cost warning for base64 text. This goes far beyond the structured data and gives the agent real operational knowledge.

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?

Though long, every sentence earns its place. The critical warning (expensive path) is front-loaded in bold, then each paragraph covers a distinct aspect: usage, parameters, return format, storage, and error handling. It is structured with clear headers and no fluff or repetition.

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

Completeness5/5

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

For a tool with three parameters, no output schema, and a complex cost profile, this description covers every essential aspect: what it returns (with a JSON structure), when to use it, how to avoid the expensive path, what the error codes mean, and the persistence model. An agent can invoke it correctly with zero prior knowledge.

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

Parameters5/5

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

Schema coverage is 0%, so the description must carry full parameter documentation. It does exactly that: explains path as the download_path/first_frame_path from a job result or bare filename, max_kb as a size ceiling with a concrete token equivalent, and force_bytes as a deliberate override with cost implications. Each parameter's purpose and default behavior is clarified.

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 opens with a precise, verb-resource statement: 'Download a generated media file (video, frame) and return its bytes, base64-encoded.' It also names the two specific uses (save or show) and distinguishes itself from the sibling download_url by explicitly warning this is the expensive path. No ambiguity about what this tool does.

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

Usage Guidelines5/5

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

It explicitly states when to use this tool versus alternatives: 'prefer download_url from the job result', and 'not to check status (use check_job for that)'. It also clarifies when force_bytes is justified and when not, giving the agent actionable decision criteria. This is exemplary guidance.

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.