Upload Media
upload_mediaUpload media to the site media library. Three modes:
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.
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).
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
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | ||
| 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 |