image_resize
Resize an image with a width, a height or both (one alone keeps the aspect ratio). fit: fill (default, stretches to exactly width x height), contain (fits inside and pads with backgroundColor), cover (fills the box and crops the overflow around the centre), inside (fits within, keeps the ratio), outside (at least as large, keeps the ratio). withoutEnlargement never makes it bigger. Reads and writes JPEG, PNG, WebP, AVIF, GIF (animation kept), TIFF; the first text item is the picture as base64, the second a JSON note with its size
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": {
"fileBase64": "<fileBase64>"
},
"name": "image_resize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | Default fill (exact width x height) | |
| width | No | Width (any to 16384) as a plain number, for example 10. | |
| format | No | png, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types also work. Default: the same format as the input | |
| height | No | Height (any to 16384) as a plain number, for example 10. | |
| quality | No | 0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF, and palette PNG | |
| animated | No | Keep every frame of an animated GIF/WebP. Default true | |
| fileBase64 | Yes | The input file as a base64 string, without a data: prefix. | |
| stripMetadata | No | Remove EXIF/GPS/colour-profile data. Default true | |
| backgroundColor | No | Fill for transparent areas (always used for JPEG), e.g. '#ffffff' or 'white' | |
| withoutEnlargement | No | true or false: without enlargement. Default false. |