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. Fetched server-side in one call, no human step. https only, SSRF-guarded on every redirect, capped at 50 MB (images/PDF) or 200 MB (video; bigger video uses the direct-PUT path below). Good for a URL you already have, 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 uploads on the quick-upload page and clicks "Done". For screenshots, recordings or local files, bulk too. filename/alt_text/title apply to the FIRST asset only.

  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.

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), the only document type; anything else is 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
agentNoYour name, on every write: Duet/<channel name> or Grok Bot/<bot name>.
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.6/5.0
Behavior4/5

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

Annotations only declare destructiveHint=false, so the description carries most of the behavioral burden and does so well: https-only, SSRF-guarded on every redirect, 50 MB / 200 MB / 1 GB caps by path, server-side fetch with 'no human step', token expiry, and pending/completed polling semantics. It stops short of stating permission or account requirements, but the mode-specific side effects are unusually well disclosed.

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?

Front-loaded with the three numbered modes, each a self-contained block with its required inputs and return shape, followed by the fallback path and a supported-types line. The density is high but every sentence adds a constraint, size cap, or return value; nothing is filler or repeated.

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 a 12-parameter tool with no output schema and minimal annotations, the description covers return shapes ({url, token, expires_at}, status plus assets[]) and the full type/size matrix. Completeness falls short only on the undocumented parameters (kind, ttl_ms, size_bytes) and on any auth or permission context for writes.

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 description coverage is only 8% across 12 parameters, so the description must compensate and largely does: it binds file_url + filename + content_type to URL mode, token to claim mode, domain/label as optional in interactive mode, and explains that filename/alt_text/title apply to the FIRST asset only. Gaps remain for kind, ttl_ms, and size_bytes, which appear in the schema with no meaning supplied anywhere.

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 concrete verb and resource ('Upload media to the site media library') and immediately partitions behavior into three explicitly named modes (URL, interactive, claim), each with its own trigger. It also distinguishes itself from the sibling upload path by naming get_media_upload_url and finalize_media_upload as the alternative 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?

Gives explicit mode-selection rules: URL mode 'for a URL you already have', interactive mode 'for screenshots, recordings or local files, bulk too', and claim mode when you hold a token and need to poll until status='completed'. It also names the concrete alternative workflow when no public URL exists, so the agent never has to guess which tool to reach for.

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.