Compress GIF
compress_gifCompress local GIF files with Gifsicle using presets, custom settings, or a target size, keeping inputs on-device and never overwriting them.
Instructions
Compress a local GIF privately with Gifsicle. Supports presets, custom settings, and a target 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": {
"input_path": "<input_path>"
},
"name": "compress_gif"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lossy | No | Gifsicle lossy level from 0 to 200. | |
| scale | No | Image scale from 0.1 to 1. | |
| colors | No | Palette size from 2 to 256 colors. | |
| preset | No | Compression preset. | balanced |
| optimize | No | Gifsicle optimization level from 1 to 3. | |
| overwrite | No | Allow replacing an existing output file. The input is never overwritten. | |
| target_mb | No | Optional target size in MB. The server progressively strengthens compression. | |
| input_path | Yes | Absolute or working-directory-relative path to a GIF file. | |
| output_path | No | Optional output GIF path. Defaults to <name>-compressed.gif beside the input. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| height | Yes | ||
| size_mb | Yes | ||
| animated | Yes | ||
| settings | Yes | ||
| target_mb | Yes | ||
| input_path | Yes | ||
| size_bytes | Yes | ||
| frame_count | Yes | ||
| output_path | Yes | ||
| saved_bytes | Yes | ||
| saved_percent | Yes | ||
| original_bytes | Yes | ||
| target_reached | Yes | ||
| compressed_bytes | Yes |