Skip to main content
Glama

Add a file to the library from a URL

upload_media_from_url
Idempotent

Download a file that is already on the web and store it in this workspace’s library. Answers with an id for a block’s mediaIds, the same kind of id list_media returns.

A URL, never the bytes — there is no way to push a file through this server. So an image you generated and hosted, a link the user gave you, or anything in their CDN works; a picture that exists only on the user’s computer does not, and that one is theirs to upload in the app.

The URL must be https and reachable without a login. A link into the user’s own network or a private address is refused rather than fetched.

JPEG, PNG, WebP, GIF, MP4, MOV, PDF, VTT or SRT. Images up to 10 MB, video and PDFs up to 100 MB, subtitle files up to 5 MB. The bytes are checked against the type the server declared, so a .png that is really something else is refused now rather than at publish time.

Set altText in the same call whenever the file is a picture. It is what a reader who cannot see it gets, and it becomes the default description everywhere this file is attached — this is the only place it can be set, so skipping it makes an undescribed image the default. Say what is in the frame, not that it is a picture.

Storage is a stock, not a rate: this counts against the plan’s allowance until the file is deleted, which frees it again. Pass an idempotencyKey and reuse it verbatim if you retry, or a call that timed out becomes two copies of the same file.

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": {
      "url": "<url>"
    },
    "name": "upload_media_from_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe https URL to download. Must be publicly reachable without a login.
altTextNoWhat the picture shows, for a reader who cannot see it.
fileNameNoWhat to call it in the library. Defaults to the last segment of the URL’s path.
idempotencyKeyNoA key of your choosing that makes this call safe to retry: retrying with the SAME key replays the first outcome instead of doing the work twice. Reuse it verbatim on a retry, and never reuse it for a different request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the accepted MIME types, per-type size ceilings, server-side content-type validation ('a .png that is really something else is refused'), and that storage counts against the plan allowance until deletion. The idempotency paragraph explains the retry semantics that `idempotentHint: true` only implies, including the failure mode (a timed-out call becoming two copies). This is behavior an agent cannot get from the structured fields.

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?

It is front-loaded with the core action and return value, then layered by decision point (source → fetch validity → type/size → altText → storage/retry), which is easy to scan. It runs long and repeats a couple of schema facts (https requirement, url reachability), but nearly every sentence carries a constraint the agent must obey.

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 tells the agent what comes back (an `id` usable in `mediaIds`). For a mutating, externally-fetching tool it covers the full set of things that can go wrong — unreachable/private URLs, wrong MIME, oversize files, duplicate retries, unfreeable storage — so nothing needed to call it correctly is missing.

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 100%, so the baseline is 3, but the description adds meaning the schema does not: `altText` is the only place the description can ever be set and becomes the default everywhere the file is attached, and `idempotencyKey` must be reused verbatim on retry. Only `fileName` goes unmentioned in the prose, which keeps it from a 5.

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 opening states a specific verb and resource — download a web-hosted file and store it in this workspace's library — and even names the artifact it produces (`id` for a block's `mediaIds`, the same kind of id `list_media` returns). This distinguishes it cleanly from the read/list siblings without needing their schemas.

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 gives concrete when-to-use cases (an image you generated and hosted, a link the user gave, anything on their CDN) and an explicit when-not with the alternative ('a picture that exists only on the user's computer does not, and that one is theirs to upload in the app'). It also states the fetch preconditions — https, publicly reachable, no link into the user's own network — that decide whether the call will succeed at all.

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