Resize an image for other platforms
create_variantsReshape ONE image already in the media library into several platform canvases at once, and return the new asset ids: feed_portrait (1080×1350, 4:5), feed_square (1080×1080), landscape (1080×566, 1.91:1) and story (1080×1920, 9:16 — also what a reel or a TikTok photo wants). Cropping is saliency-based by default: sharp scores regions by saturation, luminance and skin tone and keeps the strongest, so an off-centre subject survives a 4:5 → 9:16 cut. Use crop="centre" for images composed around their middle (posters, screenshots, flat graphics), where a predictable crop beats a guessed one. fit="contain" pads instead of cropping — use it when nothing may be cut off at all. Images only; video is not re-encoded. The source image is left unchanged and every canvas is a new asset. Variants inherit the source’s alt text and folder, and asking for two formats with the same dimensions produces one file, not two. Typical use: upload once, call this with the formats the selected platforms want, then pass the right variant id per post.
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": {
"mediaId": "<mediaId>",
"formats": "<formats>"
},
"name": "create_variants"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | 'cover' crops to fill (default); 'contain' pads to fit | |
| crop | No | 'smart' = saliency-based (default); 'centre' = predictable middle crop | |
| formats | Yes | Canvases to produce | |
| mediaId | Yes | Source image asset id (from list_media or upload_media) | |
| workspaceId | No | Which workspace to act in — an id from list_workspaces. Optional with a single workspace; REQUIRED once there are several, where guessing would mean posting one client's content to another client's accounts. Ask the user which one before publishing. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourceId | No | ||
| variants | No |