Resize or convert an image
A new image from one in the store: resized or cropped, converted to WebP, AVIF, JPEG or PNG and compressed, with GPS data removed.
$0.005 a call
From your agent’s balance. A call that fails costs nothing.
An example
Make the new Tabor photo a 1080 by 1080 square for Instagram.
Your agent callsimage_transform$0.005 a call
The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.
{
"file_id": "2c4e6a8c-0e2a-4c6e-9a0c-4e6a8c0e2a5c",
"width": 1080,
"height": 1080,
"fit": "cover",
"format": "jpeg",
"name": "tabor-square.jpg"
}Use it when
An image is too big, the wrong shape or the wrong format for where it goes.
What it does
A new image from one in the file store: resized (fit inside the box, or cover it and crop the overflow from the center), converted to WebP, AVIF, JPEG or PNG, and compressed. Photos come out turned the right way up with their metadata (GPS included) removed.
What comes back
file: the new image with its file_id, name, size and download link; width and height. Every reply also carries cost_usd and balance_usd.
Inputs
| Name | Type | What it is |
|---|---|---|
file_idRequired | string | An image in the file store. Exactly 36 characters. |
width | integer | 1 to 8,000. |
height | integer | 1 to 8,000. |
fit | string | One of: inside,cover. Default: inside. |
format | string | One of: webp,avif,jpeg,png. Default: webp. |
quality | integer | 30 to 100. Default: 82. |
name | string | Up to 200 characters. |
link_hours | integer | 1 to 168. |
The call
Over MCP, call image_transform on https://api.conecto.chat/mcp/images. Over REST:
curl -X POST https://api.conecto.chat/v1/tools/image_transform \
-H "Authorization: Bearer $CONECTO_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"2c4e6a8c-0e2a-4c6e-9a0c-4e6a8c0e2a5c","width":1080,"height":1080,"fit":"cover","format":"jpeg","name":"tabor-square.jpg"}'When it refuses
A refused call costs nothing and says what to do next.
| Code | When | What to do |
|---|---|---|
not_found404 | No file in the store has that file_id. | Find it with files_list. |
not_image400 | The file is not an image that can be read (PNG, JPEG, WebP, AVIF, GIF, BMP or TIFF). | Upload the image again in one of those formats. |
too_large413 | The image is over 40 megapixels. | Ask for a smaller copy of it. |
invalid_input400 | fit is cover without both width and height. | Send both, or fit: inside. |
storage_full409 | The file store has no room for the new image. | Delete files with files_delete, or add room with files_add_storage. |
Give this to your agent.
Set up Conecto from https://conecto.chat/SKILL.md