Skip to main content
Glama

Optimize an SVG

optimize_svg
Read-onlyIdempotent

Minify an SVG with SVGO. Send markup or a file as base64 or a public URL. Private addresses are refused and the file is capped at 10 MB. The viewBox is kept unless removeViewBox is true. Returns the optimized markup and the byte counts.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "optimize_svg"
  }
}

Input Schema

NameRequiredDescriptionDefault
svgNoSVG markup. Provide svg or file.
fileNoAn SVG file. Provide svg or file.
precisionNo
removeViewBoxNo
removeDimensionsNo

Output Schema

NameRequiredDescriptionDefault
svgYes
afterBytesYes
savedBytesYes
beforeBytesYes
savedPercentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, idempotent, and open-world traits, so the description's job is to add context — and it does: SSRF-style refusal of private addresses, a 10 MB size cap, and the default preservation of the viewBox. It does not explain what else SVGO mutates by default (e.g., precision rounding effects), which is the main behavioral unknown left.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four short sentences, front-loaded with the action, then input channels, then safety limits, then return shape. Every clause carries operational information; nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the brief return note ('optimized markup and byte counts') is sufficient, and the nested file object's url/data forms are addressed. The missing piece is meaning for precision and removeDimensions, which no structured field supplies.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 40% schema description coverage, the description must compensate, and it does for removeViewBox ('kept unless removeViewBox is true') and for the markup-vs-file choice. But precision and removeDimensions get no explanation in either the description or the schema, a real gap for two of five parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource plus the engine used: 'Minify an SVG with SVGO.' That is distinct from the neighboring compress_image/compress_pdf/convert_image tools, so an agent can pick it without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives input-channel guidance ('Send markup or a file as base64 or a public URL') and constraints (private addresses refused, 10 MB cap), but never states when to prefer this over a converter or compressor sibling, or any preconditions for choosing the file vs. markup path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.