Skip to main content
Glama

Upload Media

upload_media

Upload media to the site media library. Three modes:

  1. URL mode — pass file_url + filename + content_type. Fetches server-side, one call, no human step. file_url must be https, SSRF-guarded (blocks private/loopback/link-local/metadata, re-checked on every redirect), capped at 50 MB (images/PDF) or 200 MB (video, under the 1 GB bucket limit to fit the 30s fetch timeout — bigger video needs the direct-PUT path below). Good when an agent already has a URL, e.g. from a generation call.

  2. Interactive mode — pass nothing (or just domain/label). Returns { url, token, expires_at }: show the URL, the user signs in and uploads via the quick-upload page, then clicks "Done". Use for screenshots, recordings, or local files — avoids round-tripping bytes, supports bulk. filename/alt_text/title apply to the FIRST asset only (later images auto-generate their own; videos get none).

  3. Claim mode — pass token (from interactive mode). Returns status="completed" with an assets[] array once the user clicks Done, or "pending" while they are still uploading — poll again.

No public URL but your own HTTP client? get_media_upload_url({ domain, filename, content_type }) → { asset_id, upload_url }, PUT your bytes, then finalize_media_upload({ asset_id, domain }) — token only, no browser. Example: content/docs/features/image-upload.mdx.

Supported: jpeg, png, webp, gif, mp4, webm, quicktime, application/pdf (quick-upload: video to 1 GB, else 50 MB). Video → media_type "video", no thumbnail. PDF → "document" (thumbnail = page one, 50 MB cap), asset_id + public URL like an image — the only document type; anything else rejected.

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
kindNo
labelNo
titleNo
tokenNo
domainNo
ttl_msNo
alt_textNo
file_urlNo
filenameNo
size_bytesNo
content_typeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

With only destructiveHint=false supplied, the description carries the burden well: it discloses SSRF guards (private/loopback/link-local/metadata blocked, re-checked on redirects), size caps (50 MB images/PDF, 200 MB video URL fetch, 1 GB quick-upload), a 30s fetch timeout, and polling semantics for claim mode ('pending' vs 'completed'). Gaps remain: it never states what URL mode returns (asset_id/public URL is only implied for PDFs) and never explains kind, ttl_ms, or size_bytes, which are behavioral knobs (token lifetime in particular) an agent would want to know about.

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?

Numbered modes with bold-style lead-ins and a front-loaded one-line summary make it scannable despite its length, and the length is justified by three distinct call shapes. The closing 'Supported:' paragraph is dense but earns its place with format-to-media_type mappings; a little parenthetical hedging ('under the 1 GB bucket limit to fit the 30s fetch timeout') could be trimmed.

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

Completeness4/5

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

For an 11-parameter, zero-required, no-output-schema tool with three modes, the description covers mode selection, constraint limits, return payloads for two of three modes, and format support. It is not fully complete because the URL-mode success response is unstated and ttl_ms/size_bytes/kind remain undocumented anywhere in the definition.

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 0% and required is empty, so the schema alone gives an agent nothing about which params to combine. The description compensates strongly by defining per-mode param bundles (file_url + filename + content_type; token; optional domain/label) and the token's provenance from interactive mode. Three of eleven parameters — kind, ttl_ms, and size_bytes — are never mentioned, which keeps this below 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 description opens with a specific verb+resource ('Upload media to the site media library') and immediately decomposes it into three named modes (URL, interactive, claim). It also distinguishes itself from the sibling tools get_media_upload_url and finalize_media_upload by naming them as the alternative path for callers with their own HTTP client.

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?

Each mode carries an explicit selection condition: URL mode 'when an agent already has a URL, e.g. from a generation call'; interactive mode 'for screenshots, recordings, or local files'; claim mode after interactive. It goes further and points to the two-sibling escape hatch (get_media_upload_url → PUT → finalize_media_upload) for the no-public-URL case, which is exactly the routing an agent needs.

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