resize_image
Resize or crop images to exact dimensions with three modes: fit, fill, and crop. All processing occurs locally.
Instructions
Resize or crop an image to specific dimensions. Supports three modes: fit (preserve aspect ratio, fit within bounds), fill (preserve aspect ratio, cover bounds), crop (center crop to exact size). Works locally with Pillow.
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": {
"image_path": "<image_path>",
"width": "<width>",
"height": "<height>"
},
"name": "resize_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Resize mode: 'fit' (contain within bounds, default), 'fill' (cover bounds), 'crop' (center crop to exact size) | fit |
| width | Yes | Target width in pixels | |
| height | Yes | Target height in pixels | |
| image_path | Yes | Path to the input image file | |
| output_path | No | Path to save the output image (optional, auto-generated if omitted) |