Crop an image
crop_imageCrop an image to a pixel box or a 0 to 1 ratio box. circle cuts a round mask. format is png, jpeg, or webp. Send base64 or a public URL. Private addresses are refused and the decoded file is capped at 10 MB. Returns the image as base64.
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": "<file>"
},
"name": "crop_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| file | Yes | The image. Provide url or data. | |
| unit | No | px is source pixels. ratio is a 0 to 1 share of the source. | px |
| width | No | ||
| circle | No | ||
| format | No | png | |
| height | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Cropped image as base64. | |
| mime | Yes | ||
| bytes | Yes | ||
| width | Yes | ||
| height | Yes | ||
| filename | Yes | ||
| extension | Yes |