Optimize SVG
optimize_svgCompress SVG code locally with SVGO to reduce file size, returning the optimized SVG and before/after size measurements. Set coordinate precision as needed.
Instructions
Optimizes an SVG locally with svgo (the engine behind SVGOMG). Returns the SVG and its size before and after.
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": {
"svg": "<svg>"
},
"name": "optimize_svg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | Yes | Full SVG code | |
| precision | No | Decimal places in coordinates |