Upload Media
upload_mediaUpload media to the site media library. Three modes:
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.
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.
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
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | ||
| agent | No | Your name, on every write: Duet/<channel name> or Grok Bot/<bot name>. | |
| label | No | ||
| title | No | ||
| token | No | ||
| domain | No | ||
| ttl_ms | No | ||
| alt_text | No | ||
| file_url | No | ||
| filename | No | ||
| size_bytes | No | ||
| content_type | No |