Skip to main content
Glama

Upload media (URL or base64)

upload_media

Add an image or video to the API key's workspace media library. Returns id and url — pass the url in mediaUrls of create_post. Two modes, exactly one per call: url (direct http(s) link to the file; up to 3 redirects followed; Google Drive "anyone with the link" file links are converted automatically, other share pages such as Dropbox/WeTransfer and large Drive files with a virus-scan page are NOT supported — use create_upload_link or contentBase64 for those) or contentBase64 + mimeType (+ filename) for a file you generated yourself — one file per call (call it once per slide, e.g. 8 calls for an 8-slide carousel), JPEG/PNG/WebP/GIF/MP4/MOV, up to 10 MB decoded; prefer small/compressed files since base64 costs output tokens and hand-copied base64 of large files is error-prone: with shell access use create_upload_link + curl instead. Truncated or checksum-mismatched base64 is rejected with a clear error. Files above the size limit, wrong or mismatched types, private/localhost URLs and a full storage quota are rejected with a clear error. Needs the MEDIA_WRITE scope. If the user wants a post with an image/video but gave no URL or media id, ask first which they prefer: (a) a public link, (a2) a file the AI itself produced: upload_media with contentBase64 (one file per call, up to 10 MB, no manual step), (b) upload via a Flomixy upload link (create_upload_link; with shell access curl the returned uploadEndpoint, no base64), (c) pick from the media library (list_media), (d) a stock photo (search_stock_photos, images only), (e) generate with AI: generate_image (images only, monthly quota), (f) no media, only if the network allows it (see get_channel_capabilities). If media is already provided, do not ask.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "upload_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoDirect http(s) link to a JPEG, PNG, WebP, GIF, MP4 or MOV file (up to 3 redirects are followed). Google Drive file links shared with "anyone with the link" are auto-converted; Dropbox/WeTransfer share pages are not supported. Use this OR contentBase64.
sha256NoOptional hex SHA-256 of the file bytes, used with contentBase64; a mismatch returns "checksum mismatch" instead of a generic corrupted-image error.
filenameNoOptional original file name, e.g. slide-1.png (used with contentBase64).
mimeTypeNoRequired with contentBase64. One of: image/jpeg, image/png, image/webp, image/gif, video/mp4, video/quicktime.
contentBase64NoBase64 of the file bytes (no data: prefix needed), up to 10 MB decoded. Use this OR url.

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?

No annotations are provided, so the description carries the full burden and does so thoroughly: it discloses redirect handling (up to 3), automatic Google Drive conversion, unsupported sources (Dropbox/WeTransfer, virus-scan pages), supported formats and the 10 MB decoded limit, one file per call, base64 token cost and error-proneness, and failure modes (checksum mismatch, truncated data, wrong types, private/localhost URLs, full storage quota). It also states the required MEDIA_WRITE scope, which an agent cannot infer from a schema with zero required parameters.

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?

Purpose and return value are front-loaded, and almost every clause carries actionable information for an agent. There is measurable redundancy — the 10 MB limit appears three times and 'one file per call' twice — and the (a)-(f) decision tree makes the paragraph dense, though it is directly actionable rather than padding.

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 explains what is returned (id and url) and where it goes. For a zero-required-parameter tool with two mutually exclusive modes, it covers input constraints, error behavior, auth scope, and downstream integration completely enough that an agent can call it correctly on the first attempt.

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; the description earns above that by adding cross-parameter semantics not in the schema, such as the cost tradeoff driving the choice of contentBase64 versus create_upload_link ('base64 costs output tokens and hand-copied base64 of large files is error-prone') and the behavioral consequences of each mode's errors. The sha256 parameter is never mentioned in the description, but its schema entry is self-explanatory.

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 ('Add an image or video to the API key's workspace media library') and immediately names the return values (id and url) plus how the result is consumed ('pass the url in `mediaUrls` of create_post'). This distinguishes it from create_upload_link and list_media, which appear as alternatives later in the same description.

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?

Explicitly defines the two mutually exclusive modes ('exactly one per call') and names the alternatives with the condition that selects each: create_upload_link or contentBase64 for unsupported share pages, create_upload_link + curl when shell access exists. It then goes further with a labeled decision list (a)-(f) for the case where the user supplied no media, and an explicit 'if media is already provided, do not ask' exclusion.

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