compress_file
compressReduce a file's size while keeping its format and reasonable quality. Best for images (png/jpg/jpeg/webp/gif) and media (mp4/mp3/wav) — the file is re-encoded at a smaller size. Provide file_url or file_base64 + filename.
- When to use
- A file is too big for an upload limit or an email, and the format must stay the same. Best on png/jpg/jpeg/webp/gif and mp4/mp3/wav.
- Not for
- Changing the format — convert_file does that, and converting an image to webp usually shrinks it further than compressing the original format. Zipping several files (there is no archive tool here).
- Returns
- A signed download URL for the re-encoded file, with its new size so you can report the saving.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| file_url | string | no | Public http(s) URL of the input file (preferred). |
| file_base64 | string | no | Base64 of a small inline input file (<=15MB). Provide 'filename'. |
| filename | string | no | Original filename incl. extension (its extension is kept as the output format), e.g. 'photo.jpg'. |
| mime_type | string | no | Optional MIME type of the input. |
Example call
JSON-RPC tools/call body (sent to https://convertfleet.com/api/mcp):
{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": { "name": "compress_file", "arguments": {
"file_url": "https://example.com/input"
} }
}Connect first
curl -sN https://convertfleet.com/api/mcp \
-H "Authorization: Bearer flt_YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'See the quickstarts for Hermes, Claude, Cursor, OpenClaw, n8n, Zapier and Make.