Resize or convert an image
image_transformA 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. Costs $0.005 per call; nothing if it fails.
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": {
"file_id": "<file_id>"
},
"name": "image_transform"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | inside | |
| name | No | ||
| width | No | ||
| format | No | webp | |
| height | No | ||
| file_id | Yes | An image in the file store. | |
| quality | No | ||
| link_hours | No |