Media Upload, Auto-Fit Video & Clip Pipeline
media_pipelineExecute media ingestion, zero-egress storage uploads, automatic multi-aspect-ratio video reframing (9:16, 16:9, 1:1, 4:5), viral short clip extraction with burned-in captions, and AI visual asset generation (media_generate). For files around 100 MB or larger (including a 579048031-byte original MP4), use multipart_create → PUT each part to the returned URLs (direct to R2) → multipart_complete. Do not send the whole file through presign_upload PUT or Cloudflare returns HTTP 413. check_status is ready only when the object bytes exist in storage. Use this tool before posts_publish whenever a campaign requires uploading video/image files or converting a single landscape video into vertical Reels, TikToks, and YouTube Shorts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "media_pipeline"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | No | Uploaded parts with ETags from each part PUT, required for 'multipart_complete'. | |
| action | Yes | Media pipeline operation: 'presign_upload' creates a signed Worker PUT URL (files ≲90 MB; larger hit Cloudflare 413), 'upload_base64' uploads inline (max 20 MB), 'multipart_create' starts R2 multipart for large originals (e.g. 579048031 bytes → 64 MiB × 9 parts), 'multipart_sign_part' returns per-part PUT URLs (direct to R2 when S3 tokens are set), 'multipart_complete' verifies size/checksum and marks ready only when the object exists, 'multipart_abort' cancels, 'auto_fit_video' reframes, 'extract_clips' cuts highlights, 'media_generate' renders from a prompt, 'check_status' reports ready only when stored bytes exist. | |
| prompt | No | Creative prompt or visual template instructions when running `action: 'media_generate'` (e.g. 'Minimalist B2B architecture diagram for MCP server launch'). | |
| sha256 | No | Alias of checksum. | |
| checksum | No | Optional SHA-256 hex of the original file. Verified on complete when R2 exposes a checksum. | |
| fileName | No | Original file name with extension (e.g. 'keynote-demo.mp4' or 'launch-carousel.png') when requesting a presigned upload URL. | |
| mimeType | No | MIME type of the media asset being uploaded or generated (e.g. 'video/mp4', 'image/png', 'image/jpeg', 'image/svg+xml'). | video/mp4 |
| uploadId | No | R2 multipart upload id returned by 'multipart_create'. | |
| clipCount | No | Number of short highlight clips (1 to 10) to extract from a long-form source video when `action` is 'extract_clips'. | |
| profileId | No | Brand profile identifier (`prof_...`) that owns the media asset. | prof_allometrik |
| sizeBytes | No | File size in bytes used to validate upload quotas and allocate storage buffers. | |
| dataBase64 | No | Base64-encoded file bytes for 'upload_base64' (max 20 MB decoded). | |
| partNumber | No | Single part number alternative to partNumbers. | |
| contentType | No | MIME type for 'upload_base64' (alias of mimeType), e.g. 'image/jpeg'. | |
| partNumbers | No | Part numbers to sign (1-based). For a 579048031-byte file at 64 MiB parts use [1,2,3,4,5,6,7,8,9]. Omit to sign every planned part. | |
| mediaAssetId | No | Existing media asset identifier (`med_...`) to reframe, extract clips from, or inspect status. | |
| partSizeBytes | No | Optional part size in bytes (default 67108864 / 64 MiB). Must be ≥ 5242880 for multi-part objects. | |
| targetAspectRatios | No | Target aspect ratios for automatic video/image reframing: '9:16' (Reels/TikTok/Shorts), '16:9' (X/LinkedIn/YouTube), '1:1' (Square), '4:5' (Portrait Feed). |