Skip to main content
Glama

Trace an image to clean SVG

trace_icon

Converts a raster icon or logo image into a clean, editable SVG with real colour shapes and fitted curves, auto-choosing mono or colour, gradients and resolution.

Instructions

Vectorize a raster image into a clean, editable SVG: colour regions become real shapes with fitted curves, not a traced outline of pixels. Decides colour vs mono, gradient fitting and trace resolution automatically (override with the options). Writes the .svg and reports path count, node count and the decisions it made.

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": {
      "image": "<image>"
    },
    "name": "trace_icon"
  }
}

Input Schema

NameRequiredDescriptionDefault
inkNoPaint a MONO trace in this instead of the ink the probe read: a hex colour, or "currentColor" so the icon takes the CSS text colour (what an icon set wants). Colour traces keep their colours.
outNoWhere to write the SVG. Default: next to the source, same name, .svg extension (<name>.traced.svg when the source is itself that .svg, so it is never overwritten).
modeNoauto (default) counts the inks: one ink on paper traces mono, which is far cleaner for line art; anything else traces colour.
imageYesPath to the image to trace (PNG, JPEG, WebP, GIF, BMP, or an SVG to re-trace).
insetNoWith normalize: units kept clear on each side. Default size/12 (2 on a 24 grid, as Lucide draws).
quietNoReturn only the summary (one line per icon for a sheet) and skip the JSON block. For batches, where the JSON repeats what the summary says.
detailNohigh lifts the flat-art raster cap 2048 → 4096: crisper, ~4x the work.
inlineNoAlso return the SVG markup in the response (only do this for small icons).
searchNoCheck the automatic choices instead of trusting them: trace the choices left on auto (mono vs colour, gradients on vs off) each way, score every candidate against the image (mean ΔE), and keep the automatic pick unless another candidate is clearly closer. A forced mode or gradients is kept. About 2.5x slower (one full trace per candidate). The plan reports every candidate’s score. Default on; false keeps the automatic pick untested.
strokesNoTrace LINE ART as centreline strokes with a measured stroke-width (open and closed stroked paths you can re-weight), instead of filled outlines of each line. Ink no stroke explains (a dot, a note head) still becomes a fill. In colour mode each stroke is painted in the ink it runs through. Default off.
fidelityNoShape-beautification tolerance in px; 0 disables snapping to circles/lines.
layeringNoColour mode. stacked (default): a shape paints under the shapes in front of it — fewer nodes, no hairline seams between colours, shapes stay whole in a design tool. tiled: shapes fit edge to edge, with a hole wherever another sits inside. Same edges either way; mono ignores it.
despeckleNo0 keeps every speck, 100 is aggressive. Default 25.
gradientsNoauto (default) probes for real colour ramps. flat forces solid fills (right for most icons). rich forces gradient fitting.
normalizeNoRefit the SVG into a square viewBox of this many units: normalize: 24 fits the art into "0 0 24 24", centred, with `inset` units clear on every side, coordinates rounded to 2 decimals — so every icon of a set shares one grid. Stroke widths scale with it. Omit to keep the viewBox at the traced pixel size.
smoothingNo0 = crisp and node-dense, 100 = smooth and sparse. Default 50.
flattenOntoNoComposite a TRANSPARENT source onto this colour before tracing, e.g. "#ffffff". Omit to keep the alpha. (Not the card colour — that is appearance.background.)
strokesOnlyNoWith `strokes`: NO filled paths at all — the ink no stroke explains (a dot, a note head, a solid shape) is drawn as round-capped strokes too, along its own middle and as wide as it is there; a dot is a round-capped point. Nothing is dropped, but a shape that is not a line is approximated (a square comes back with round ends). For plotters and stroke-only icon sets. Default off.
removeBackgroundNoDrop the detected background layer so the SVG comes back transparent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that the tool writes an .svg file, that it auto-decides colour/mono, gradients and resolution, and that it reports path count, node count and its decisions. It also flags relative cost implications (search ~2.5x slower, high detail ~4x work), which is real behavioral context an agent can't infer from the schema.

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?

Three sentences, front-loaded with the core verb and the differentiating mechanism, then the automation behavior, then the side effect and return summary. No filler, and it stays compact despite 19 parameters.

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?

For a 19-parameter tool with no annotations and no output schema, the description covers the essential gaps: it states it writes a file and summarizes what comes back (path count, node count, decisions). It stops short of error behavior or invalid-input handling, but nothing critical to calling it correctly is missing.

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?

Schema description coverage is 100%, so each of the 19 parameters is already documented in detail; the description's only added parameter meaning is that the trace decisions can be overridden. Baseline 3 applies because the schema, not the description, is doing the semantic work.

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 ("Vectorize a raster image into a clean, editable SVG") and immediately distinguishes its output from a naive tracer: "colour regions become real shapes with fitted curves, not a traced outline of pixels." That contrast makes it identifiable against siblings like inspect_icon or export_icons without opening the 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 explains defaults and that the automatic decisions can be overridden with options, and the quiet/ink parameter text hints at batch and icon-set use cases. However, it never says when to reach for this tool versus inspect_icon or export_icons, and there is no explicit when-not guidance at the description level.

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

This server cannot be deployed

Other Tools