Skip to main content
Glama

Get media URL

get_media_url
Read-onlyIdempotent

Get a fresh, signed download URL for one of the user's files (an outputFileId from a generation, or a fileId from the library). The URL works without signing in and expires after ttlMinutes (default 60, max 1440). Use it when an outputUrl has expired or is not directly downloadable. Fails if the file is still being generated or uploaded. For a generation's output it also returns a small preview image (for a video, its poster frame), since some clients can't open the URL themselves.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fileId": "<fileId>"
    },
    "name": "get_media_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileIdYesFile id (outputFileId, or a library file id).
ttlMinutesNoHow long the URL stays valid, in minutes (default 60).
includePreviewNoAttach a preview image when the file is a generation's output (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: the URL is signed, requires no sign-in, expires per ttlMinutes, and the call fails if the file is still generating or uploading. It also discloses that a preview image (poster frame for video) comes back, which is non-obvious extra behavior.

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?

Front-loads the core action and expiry, then layers usage trigger, failure mode, and return detail. Four sentences with no filler; the closing rationale ('since some clients can't open the URL themselves') is mildly verbose but justifies the preview behavior.

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?

With no output schema, the description still describes the returned artifact (URL plus optional preview image) and its expiry semantics. Combined with a fully documented 3-parameter schema and safety annotations, an agent has everything needed to call it correctly.

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

Parameters4/5

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

Schema coverage is already 100%, so the baseline is 3; the description still adds value by explaining where fileId comes from (outputFileId vs library fileId) and by clarifying the includePreview preview/poster-frame behavior and its client-side rationale. It does not add anything new for ttlMinutes beyond the schema's default and max.

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?

States a specific verb and resource ('Get a fresh, signed download URL') and immediately scopes it to 'one of the user's files', clarifying the two accepted id sources. It is clearly distinguishable from siblings like list_library_files or get_generation_status, which retrieve metadata rather than a URL.

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?

Explicitly says to 'Use it when an outputUrl has expired or is not directly downloadable', which gives a concrete trigger condition. It does not name alternative tools for the adjacent tasks (e.g. listing files to obtain a fileId), so it stops short of full when-not/alternative 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.

Resources