Upload Media (Popcraft)
popcraft_media_uploadGet upload URLs for a local image/video/audio file that has no public URL to hand to popcraft_media_import_url. THIS IS THE TOOL FOR VIDEO and for anything over 20 MB. Returns a proxy_upload_url on Popcraft's OWN host (PUT the bytes there — total file size up to the per-type cap: video 500 MB, image 30 MB, audio 50 MB; each individual REQUEST is capped at 28 MB by the transport, so files over 28 MB use the chunked recipe B — same URL, same total cap) and an upload_url for a direct PUT to storage.googleapis.com (fewer hops, but a different host that sandboxed clients often cannot reach). The result text contains ready-to-run shell recipes including the chunked one for large files — RUN one of them rather than reimplementing the upload. Running a shell command also keeps the file bytes out of your context, which is why this beats popcraft_media_upload_inline for video: that tool needs the whole file base64-encoded in its arguments, so it is only practical for small files. CAUTION on platform-mediated clients (e.g. claude.ai connectors): tool calls are made from the platform's servers, so this call succeeding does NOT prove your shell can reach Popcraft — run the 5-second egress probe in recipe 0 first. If your shell's egress is blocked: prefer asking the user for any shareable link to the file (Drive/Dropbox/etc) and popcraft_media_import_url (server-side fetch, immune to client egress blocks); if no link exists, open popcraft_media_upload_widget when the client renders widgets. After the upload, call popcraft_media_confirm with the returned media_id to verify it landed, then pass that media_id as a medias[].value for popcraft_generate_image / popcraft_generate_video / popcraft_generate_audio. If you have no shell and no network at all, fall back to popcraft_media_upload_inline — but never tell the user to upload the file on the website instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | Original filename (used for content-type hinting and readability only — the stored path is unique regardless) | |
| size_bytes | No | Size of the file in bytes. Pass it so an over-limit file is rejected before you upload (caps: image 30MB, video 500MB, audio 50MB, 3D 150MB). | |
| content_type | Yes | MIME type of the file, e.g. image/png, video/mp4, audio/mpeg. Accepted: jpeg/png/webp/gif images, mp4/webm/mov video, mp3/wav/ogg/aac/m4a audio, glb/fbx 3D — anything else is rejected. |